1 Introduction

Due to limitation in production resources related to economical aspect and environmental constraints, transmission systems are forced to operate very close to their security limits. Statistical researches clearly confirmed that the majority of blackout occurred in the world lies on critical situations such as load growth and faults at important transmission lines. Ensuring flexible and optimal equilibrium between energy production and consummation under severe disturbances such as load growth and faults is a challenge to experts and industrials. Since the simplified economic dispatch introduced by Carpentier [1], a large number of projects and researches have been developed to solve the original formulation of optimal power flow [2]. In the literature, various mathematical methods have been applied to solve the simplified OPF [2,3,4,5,6,7]. As well confirmed by the majority of researches, the determinist methods rely on some simplification assumptions such as initial condition, convexity of objective function, continuity and differentiability fail to achieve the global solution in particular when practical constraints related to generating units such as valve-point effect, multi-fuel and prohibited zones and also by considering critical situations such as load growth and cascade contingencies. The actual OPF problem known as security OPF is an important subproblem of modern power system planning and control. Security OPF consists in optimizing one or multi-particular objective functions by adjusting a set of continuous and discrete control variables under critical situations such as load growth and contingency, while satisfying operation and security constraints [8]. The extensive necessity to solve practical problems related to power system operation and control and to overcome the drawbacks of the traditional methods, an efficient category of global optimization methods called metaheuristics has been developed and proposed in a large number of papers to solve several problems related to modern power system operation and control [9, 10]. In [11], a novel algorithm inspired from the gray wolf behavior is proposed to solve various optimization problems. In order to enhance the performances of the recent original GWO algorithm in solving practical OPF considering loading margin stability and contingency, a flexible planning strategy adapted with GWO algorithm is proposed in [12] to solve Blackout risk prevention in a smart grid, in [13], also the concept of gray wolf optimizer is adapted and applied for solving the optimal reactive power dispatch problem, in [14] a new hybrid method based on the combination between PSO and multi-verse optimizer named (HPSO-MVO) is proposed and applied to solve the reactive power planning. The main idea introduced is that the PSO technique used for exploitation phase and MVO for exploration phase which allows creating flexible balance between the two phases to achieve the near global solution, in [15] a modified bacteria foraging algorithm is adapted and applied for solving the security-constrained optimal power flow considering both the wind sources and conventional thermal generation, and in [16] a hybrid method called Fuzzy harmony search algorithm is proposed and applied to solve security OPF problems, a Fuzzy logic system (FLS) is adapted to adjust dynamically the pitch rate (PR) and bandwidth rate of the original Harmony search algorithm, the performances of the combined method have been improved compared to the standard Harmony search algorithm, in [17] a new adaptive partitioning flower pollination algorithm (AFPA) was applied to solve the security-constrained optimal power flow, the new adaptive mechanism search based on adjusting dynamically particular parameters of the FPA is proposed to enhance the performances of the original FPA in terms of solution quality and maximum number of generation and trials required, in [18] a supervised firefly algorithm is applied for optimal placement and sizing of voltage controlled distributed generators in unbalanced distribution networks, in [19] a new symbiotic organisms search algorithm is applied for solving the optimal power flow problem considering practical constraints such as valve-point effect and prohibited zones, in [20] a differential search algorithm is proposed for solving multi-objective optimal power flow problem, in [21], a novel Moth Swarm Algorithm (MSA), inspired by the orientation of moths toward moon light, is adapted and applied to solve constrained OPF problem, the particularity of the proposed variant based on association of learning mechanism with immediate memory and population diversity crossover for Lévy-mutation is to establish a tradeoff between the exploitation and exploration during search process. In [22], and in order to improve performances of the standard PSO by well balancing between exploration and exploitation search process to achieve the near global optimum, a new variant-based PSO named particle swarm optimization with an aging leader and challengers algorithm was adapted for solving the OPF, in [23] a contingency partitioning approach for preventive-corrective security-constrained optimal power flow computation is proposed, in [24] an adaptive real-coded biogeography-based optimization is applied for solving the optimal power flow for a deregulated power system, in [25], a combined method based on particle swarm optimization and gravitational search algorithm (PSOGSA) is efficiently adapted and applied to solve the optimal reactive power dispatch. The main particularity of the proposed hybrid method is that the GSA designed to achieve the exploration phase, and PSO adapted to achieve the exploitation phase, in [26] a parallel metaheuristics method for graphics processing units is successfully applied for solving the large OPF, the robustness of this parallel optimization technique validated on two large test systems IEEE 118-Bus and IEEE 300-Bus and will be considered as a useful and a competitive tool to solve various practical power system planning for large test systems.

From the review and statistical analysis of the different global optimization methods cited in the recent literature which applied to solve the security OPF problems, we can conclude that the main particularities of these methods in terms of solution quality and convergence characteristics are summarized as follows:

  • A number of new methods and developed variants-based standard metaheuristics methods have been investigated in how to choose and adjust the best initial parameters to achieve the near global solution.

  • In special complex optimization cases with various objective functions, the dynamic adjustment of parameters is not sufficient to achieve the best solution, in such situations, the hybridization concept is introduced to maintain flexible interaction between exploration and exploitation during search process to achieve the near global solutions.

  • For solving large power systems with accuracy, the concept of parallelism is also investigated in many papers. The parallel execution of multi-subsystems enhances the solution quality and reduces the execution time in particular in solving large practical power systems.

We can conclude that, due to the complexity of the practical power system planning problems, characterized by the nonlinearity of objective functions and constraints, there is no à generalized method can be considered as a standard tool in solving all optimization problems related to power system planning operation and control. Therefore, recently there is huge number of novel algorithms proposed to solve various optimization problems. One of the very recently developed optimization techniques is the sine cosine algorithm (SCA) which is a population-based optimization algorithm introduced by Mirjalili [27] for solving several real optimization problems. The performances of the SCA have been well demonstrated on a set of well-known test cases including unimodal, multi-modal, and composite functions [27]. The main particularity of the SCA is related to its simplicity in programming and its ability to maintain a flexible balance between exploration and exploitation during search process.

In this paper, a new planning power system strategy implemented within a new interactive variant-based SCA is proposed to improve the solution of security OPF under critical situations such as loading margin stability and contingency. The novelty and contributions of this paper can be outlined as follows:

  • Two indices named critical reactive margin stability and global critical reactive margin stability are proposed to find the first initial feasible solution.

  • The loading margin stability is an important index for blackout prevention strategy of practical power system. A new power system planning strategy based on reactive margin stability index is implemented within the SCA to improve the margin loading stability considering contingency.

  • A parallel execution of the SCA based on three practical candidate initial solutions is proposed.

  • During search process, three control parameters r1, r2, and r3 are dynamically adjusted to overcome the premature convergence.

  • The proposed power system planning strategy is capable of finding a competitive solution of margin loading stability in coordination with various objective functions such as voltage deviation, total power loss and voltage stability.

The performances of the proposed new variant-based SCA are tested and validated on two practical test systems, the IEEE 30-Bus and the IEEE 118-Bus considering various objective functions such as minimization of fuel cost, voltage deviation, total power loss, and total voltage stability. These objective functions are optimized at normal condition and under critical situations such as loading margin stability and contingency.

2 Multi-objective optimal power flow

The multi-objective OPF is an important subproblem of power system planning and control. It consists of optimization of one or a combination of many objective functions by adjusting the setting of control variables, while satisfying several equality and inequality constraints [12]. In general form, the mathematical formulation of the standard multi-objective OPF problem is given as follows:

$$\begin{aligned} \hbox {Minimize}\; J_i \left( {x,u} \right) \quad i= & {} 1,\ldots ,N_\mathrm{obj} \end{aligned}$$
(1)
$$\begin{aligned} \hbox {Subject to: } g\left( {x,u} \right)= & {} 0 \end{aligned}$$
(2)
$$\begin{aligned} h\left( {x,u} \right)\le & {} 0 \end{aligned}$$
(3)

where \(J_{i}\) is the ith objective function, and \(N_\mathrm{obj}\) is the number of objective functions, g and h are the equality and inequality constraints, related to power balance and power system security. The vector of state and control variables are denoted by x and u, respectively.

  • 1. State variables

In general, the state vector variable is expressed as:

$$\begin{aligned} x=\left[ {\delta ,V_\mathrm{L},P_\mathrm{Gs} ,Q_\mathrm{g}} \right] ^\mathrm{T} \end{aligned}$$
(4)

The state variable composed by:

Load bus voltage angles \(\delta \), load bus voltage magnitudes \(V_\mathrm{L}\), slack bus real power generation \(P_\mathrm{Gs}\), and generator reactive power \(Q_\mathrm{g}\).

  • 2. Control variables

The vector control variable is expressed by:

$$\begin{aligned} u=\left[ {P_\mathrm{g},V_\mathrm{g} ,B_\mathrm{sh} ,B_\mathrm{svc} ,t} \right] ^\mathrm{T} \end{aligned}$$
(5)

The control variables consist of:

Real power generation \(P_\mathrm{g}\), generator terminal voltage \(V_\mathrm{g}\), shunt capacitors/reactors \(B_\mathrm{sh}\), shunt dynamic compensators (SVC) \(B_\mathrm{svc} \), and transformers tap ratio t.

2.1 Constraints

  1. 1.

    Equality constraints

In general, the equality constraints g(x) represent the balance between production and consummation. The real and reactive power balance equations are expressed by the two generalized equations:

$$\begin{aligned}&P_{\mathrm{g}i} -P_{\mathrm{d}i} -V_i \sum _{j=1}^N {V_j \left( {g_{ij} \cos \delta _{ij} +b_{ij} \sin \delta _{ij} } \right) } =0 \end{aligned}$$
(6)
$$\begin{aligned}&Q_{\mathrm{g}i} -Q_{\mathrm{d}i} -V_i \sum _{j=1}^N {V_j \left( {g_{ij} \sin \delta _{ij} -b_{ij} \cos \delta _{ij} } \right) } =0 \end{aligned}$$
(7)

where N is the number of buses, \(P_{\mathrm{g}i} \), \(Q_{\mathrm{g}i} \) are the active and the reactive power generation at bus i; \(P_{\mathrm{d}i} \), \(Q_{\mathrm{d}i}\) are the real and the reactive power demand at bus i; \(V_i \), \(V_j\), the voltage magnitude at bus i, j, respectively; \(\delta _{ij}\) is the phase angle difference between bus i and bus j, respectively, \(g_{ij}\) and \(b_{ij}\) are the real and imaginary parts of the admittance \((Y_{ij} )\).

  1. 2.

    Inequality constraints

In general, the inequality constraints are associated with reliable operation of all elements of power system, and reflect the security limits associated with sate and control variables organized as follows:

$$\begin{aligned}&V_{\mathrm{g}i}^\mathrm{min } \le V_{\mathrm{g}i} \le V_{\mathrm{g}i}^\mathrm{max } ,\quad i=1,2,\ldots ,Npv \end{aligned}$$
(8)
$$\begin{aligned}&P_{\mathrm{g}i}^\mathrm{min } \le P_{\mathrm{g}i} \le P_{\mathrm{g}i}^\mathrm{max } ,\quad i=1,2,\ldots ,Npv \end{aligned}$$
(9)
$$\begin{aligned}&Q_{\mathrm{g}i}^\mathrm{min } \le Q_{\mathrm{g}i} \le Q_{\mathrm{g}i}^\mathrm{max } ,\quad i=1,2,\ldots ,Npv \end{aligned}$$
(10)
$$\begin{aligned}&t_i^\mathrm{min } \le t_i \le t_i^\mathrm{max } ,\quad i=1,2,\quad ,Nt \end{aligned}$$
(11)
$$\begin{aligned}&B_{^\mathrm{SVC}}^\mathrm{min } \le B_\mathrm{SVC} \le B_{^\mathrm{SVC}}^\mathrm{max } \end{aligned}$$
(12)
$$\begin{aligned}&V_{\mathrm{L}i}^\mathrm{min } \le V_{\mathrm{L}i} \le V_{\mathrm{L}i}^\mathrm{max } , \quad i=1,2,\ldots ,Npq \end{aligned}$$
(13)
$$\begin{aligned}&S_{\mathrm{l}i} \le S_{\mathrm{l}i}^\mathrm{max } ,\quad i=1,2,\ldots ,Nbr \end{aligned}$$
(14)

where \(V_{\mathrm{g}i}^\mathrm{min } \), \(V_{\mathrm{g}i}^\mathrm{max}\) are the limits on the generator bus voltage magnitude, \(P_{\mathrm{g}i}^\mathrm{min}\), \(P_{\mathrm{g}i}^\mathrm{max}\) are the limits on the output of active power generation, \(Q_{\mathrm{g}i}^\mathrm{min}\), \(Q_{\mathrm{g}i}^\mathrm{max}\) are the limits on the output of reactive power generation, \(t_{i}^\mathrm{min}\), \(t_i^\mathrm{max}\) are the limits on the tap ratio (t) of transformer, \(B_{^{SVC}}^\mathrm{min}\), \(B_\mathrm{SVC}^\mathrm{max}\) are upper and lower susceptance limits of shunt SVC Controllers, \(V_{\mathrm{L}i}^\mathrm{min}\), \(V_{\mathrm{L}i}^\mathrm{max}\) are the limits on voltage magnitude at loading buses (PQ bus) and \(S_{\mathrm{l}i}^\mathrm{max}\) is the maximum transmission line loading.

2.2 Objective functions

In the literature, many objective functions have been used by researchers to evaluate and improve the performances of practical power systems. These objective functions may be optimized individually and simultaneously.

  1. 1.

    Minimization of total cost

The total fuel cost is the most objective functions largely considered in security OPF studies. The quadratic form is the simple model which is formulated using the following equation:

$$\begin{aligned} J_1 (x,u)=\sum _{i=1}^\mathrm{NG} {\left( {a_i +b_i P_{\mathrm{g}i} +c_i P_{\mathrm{g}i}^2 } \right) } \end{aligned}$$
(15)

where NG is the number of thermal units, \(P_{\mathrm{g}i}\) is the active power generation at unit i, and \(a_{i}\), \(b_{i}\) and \(c_{i}\) are the cost coefficients of the ith generator that reflect the quadratic form.

  1. 2.

    Minimization of voltage deviation

The total voltage deviation is optimized by minimizing the following objective function:

$$\begin{aligned}&\hbox {VD}=\sum _{i\in \mathrm{NL}} {\left| {V_i -V_\mathrm{ref} } \right| } \end{aligned}$$
(16)
$$\begin{aligned}&J_2 \left( {x,u} \right) =\hbox {VD}+\hbox {Penalty} \end{aligned}$$
(17)

where \(V_\mathrm{ref}\) is the desired voltage at all load buses, in general taken equal to 1 p.u.

  1. 3.

    Minimization of voltage stability index

Voltage stability index firstly introduced by Kessel and Glavitch [28] becomes an important index to electric utility. The developed index named L-index is based on the feasibility of power flow equations for each node. The L-index of a bus indicates the proximity of voltage collapse condition of that bus. It varies between 0 and 1 corresponding to no load and voltage collapse, respectively.

The objective function related to voltage stability can be expressed as follows:

$$\begin{aligned} L_{\mathrm{max}} =\max \left( {L_j } \right) \quad j=1,2,\ldots , N_L \end{aligned}$$
(18)

where \(L_j \) denotes the individual L-index of bus j.

Therefore, in order to simultaneously minimize the total fuel cost in coordination with total voltage stability represented by \(L_{\max } \), the two objective functions are combined as follows:

$$\begin{aligned} J_3 \left( {x,u} \right) =\sum _{i=1}^\mathrm{NG} {\left( {a_i +b_i P_{\mathrm{g}i} +c_i P_{\mathrm{g}i}^2 } \right) } + \lambda _{L \mathrm{max}} \times L_{\mathrm{max}}\nonumber \\ \end{aligned}$$
(19)

where \(\lambda _{L \mathrm{max}}\) is a weighting factor, determined by experience to balance between the two objective functions.

  1. 4.

    Minimization of a combined voltage deviation and cost

In order to simultaneously minimize the voltage deviation in coordination with total fuel cost, the following combined equation is proposed:

$$\begin{aligned} J_4 \left( {x,u} \right) =\sum _{i=1}^\mathrm{NG} {\left( {a_i +b_i P_{\mathrm{g}i} +c_i P_{\mathrm{g}i}^2 } \right) } +\lambda _\mathrm{VD} \times \hbox {VD} \end{aligned}$$
(20)

where \(\lambda _\mathrm{VD} \) is a scaling factor chosen to balance between the two objective functions.

  1. 5.

    Minimization of total power losses

The total active power loss is optimized by minimization the following objective function:

$$\begin{aligned}&P_\mathrm{loss} =\sum _{k=1}^{N_l } {g_k } \left[ {\left( {t_k V_i } \right) ^{2}+V_j^2 -2t_k V_i V_j \cos \delta _{ij} } \right] \end{aligned}$$
(21)
$$\begin{aligned}&J_5 \left( {x,u} \right) =P_\mathrm{loss} +\hbox {Penalty} \end{aligned}$$
(22)
  1. 6.

    Minimization of a combined total power loss and cost

In order to simultaneously minimize the total power loss in coordination with total fuel cost, the following combined equation is proposed:

$$\begin{aligned} J_6 \left( {x,u} \right) =\sum _{i=1}^\mathrm{NG} {\left( {a_i +b_i P_{\mathrm{g}i} +c_i P_{\mathrm{g}i}^2 } \right) } +\lambda _{pl} \times P_\mathrm{loss} \end{aligned}$$
(23)

where \(\lambda _{pl}\) is a scaling factor chosen to balance between the two objective functions.

  1. 7.

    Maximization of loading margin stability

The loading margin stability is an important index which reflects the ability of the system to deliver dynamically power to consumer under critical situations [12]. As a result and to ensure the security of practical power system under load growth, the loading margin stability is optimized considering various objective functions such as, the total voltage deviation and the total power loss. The schematic representation of loading margin stability is shown in Fig. 1. The following equations describe the loading margin stability index.

$$\begin{aligned} P_\mathrm{new}= & {} \lambda \cdot P_\mathrm{base} \end{aligned}$$
(24)
$$\begin{aligned} Q_\mathrm{new}= & {} \lambda \cdot Q_\mathrm{base} \end{aligned}$$
(25)

where \(P_\mathrm{new} ,P_\mathrm{base}\): the new and base active power demands

$$\begin{aligned} J_7 \left( {x,u} \right) =\hbox {Max}\left( \lambda \right) \end{aligned}$$
(26)

\(Q_\mathrm{new} , Q_\mathrm{base}\): the new and base reactive power demands.

  1. 8.

    Maximization of loading margin stability and total power loss

Fig. 1
figure 1

Loading margin stability

The loading margin stability is maximized in coordination with total power losses. The following equation describes the combined objective function, in this study \(\alpha \) is taken 0.5.

$$\begin{aligned} J_8 \left( {x,u} \right) =\alpha \times J_3 \left( {x,u} \right) +\left( {1-\alpha } \right) \times J_2 \left( {x,u} \right) ,\quad 0\le \alpha \le 1 \end{aligned}$$
(27)
  1. 9.

    Maximization of loading margin stability and total voltage deviation

In this case, the loading margin stability is maximized in coordination with total voltage deviation. The following equation describes the combined objective function:

$$\begin{aligned} J_9 \left( {x,u} \right) =\alpha \times J_3 \left( {x,u} \right) +\left( {1-\alpha } \right) \times J_1 \left( {x,u} \right) ,\quad 0\le \alpha \le 1 \end{aligned}$$
(28)
  1. 10.

    Critical reactive margin security

At critical situations such as load growth and contingency, it is important to maintain reactive power of generating units at security levels. Optimal coordination of reactive power delivered by generating units and multi-shunt FACTS devices is an important task to enhance the stability of power systems. In this study, two indices are proposed to measure and evaluate the performance of practical power systems.

$$\begin{aligned} \hbox {CRMS}_i =\left\{ {{\begin{array}{ll} \hbox {abs}\left( {\frac{\hbox {QG}_i }{\hbox {QG}_\mathrm{min} }} \right) &{}\quad \hbox {if}\;\; \hbox {QG}_i <0 \\ \left( {\frac{\hbox {QG}_i }{\hbox {QG}_\mathrm{max } }} \right) &{}\quad \hbox {if}\;\; \hbox {QG}_i >0,\;\; i=1,\ldots ,\hbox {NG} \\ \end{array} }} \right. \end{aligned}$$
(29)
  1. 11.

    Global reactive margin security

The higher GRMS indicates the higher degree of security and stability of power system. This index must be considered in coordination with other control variables to maintain the power system at reliable situation.

$$\begin{aligned} \hbox {GRMS}=\frac{1}{\sum \nolimits _{i=1}^\mathrm{NG} {\hbox {CRMS}_i } } \end{aligned}$$
(30)
Fig. 2
figure 2

Basic steps of the SCA

Fig. 3
figure 3

Effects of sin and cosine on search process

3 Algorithm description

Very recently, a new interactive optimization algorithm was proposed for solving optimization problems. The particularity of the SCA can be outlined as follows:

  1. 1.

    The SCA creates multiple initial random candidate solutions and requires them to fluctuate outwards or toward the best solution [27] based on sine and cosine functions.

  2. 2.

    Exploration phase is performed when the sin and cosine functions return a value greater than 1 or less than −1.

  3. 3.

    The exploitation phase is performed when sin and cosine functions return value between 1 and −1.

  4. 4.

    A specified random and adaptive variables are intergraded within the algorithm to balance between exploration and exploitation during search process. The basic steps of the SCA are presented in Fig. 2. The structure of the standard mechanism search of the SCA can be summarized as follows [27].

Phase 1: Generate random solution Like many population-based optimization techniques, the SCA starts the optimization search process with a random solution. Figure 3 shows the standard sin cosine search process transition.

Phase 2: Evaluate and update solution This random solution is evaluated repeatedly by a specified objective function and improved by a set of rules for exploration and exploitation stages. These two equations updated based on a switching parameter and are expressed as follows:

$$\begin{aligned} X_i^{it+1} =\left\{ {{\begin{array}{ll} X_i^{it} +r_1 \times \sin \left( {r_2 } \right) \times \left| {r_3 P_i^{it} -X_i^{it} } \right| ,&{} r_4 \prec 0.5 \\ X_i^{it} +r_1 \times \cos \left( {r_2 } \right) \times \left| {r_3 P_i^{it} -X_i^{it} } \right| ,&{} r_4 \ge 0.5 \\ \end{array} }} \right. \end{aligned}$$
(31)

where \(X_i^{it}\) is the position of the current solution in i-th dimension at it-th iteration, \(r_1 /r_2 /r_3\) are random numbers, \(P_i^{it}\) is the destination point in i-th dimension.

\(r_1\)::

is designed to guide the next position’s region, which may be between the solution and destination or outside it. In order to achieve balance between exploration and exploitation phase, this parameter is dynamically adjusted during search process using the following equation:

$$\begin{aligned} r_1 =a-it\times \frac{a}{it\, \mathrm{max}} \end{aligned}$$
(32)

where it is the current iteration, a is a constant and \(it\,max\) is the maximum number of iteration

\(r_{2}\)::

is designed to decide how far the movement should be toward or outward the destination.

\(r_{3}\)::

is a random weighting parameter.

\(r_{4}\)::

is a switching parameter that switches the transition between the sine and cosine components in Eq. (31).

The effects of sin and cosine on the search process are well illustrated in Fig. 3. For exploring the search space, the solutions should be able to search outside the space between their corresponding destinations as well. This can be achieved by changing the range of the sine and cosine functions as shown in Fig. 3a.

Figure 3b shows how changing the range of sine and cosine functions requires a solution to update its position outside or inside the space between itself and another solution [27]. Therefore, this search mechanism guarantees an efficient balance between exploration and exploitation.

4 Proposed power system planning strategy

The main contribution of the proposed planning strategy is its ability to locate the maximum loading margin stability under critical situations such as contingency. Firstly and in order to reduce the search space the SCA is performed in parallel to locate the suboptimal solutions at different levels of GRMS to generate initial database. Secondly, the basic SCA is modified by dynamically adjusting particular parameters during search process to well creating balance between exploration and exploitation phases.

Fig. 4
figure 4

Interactive mechanism search-based SCA

Based on schematic representation shown in Fig. 4, the following points summarize the novelty and particularity of the proposed mechanism search introduced within the modified SCA.

1. Stage 1::

Generate initial database In this stage, the two objective functions are optimized at different levels of GRMS. This first operation contributes to locate the suboptimal solutions, three GRMS have been considered.

2. Stage 2::

At the first trial, the three suboptimal solutions found during the first stage are considered as an initial solution to the first SCA1. During this stage, two SCAs are executed, SCA1 receive the first initial population without considering different levels of GRMS, and SCA2 receive the subpopulations considering different levels of GRMS. Figure 4 shows the mechanism search of the proposed planning strategy.

3. Stage 3::

The control variables associated with the new suboptimal solutions achieved during the first trial are saved and considered as an initial solution. In order to make diversity in search space, the worst solution found is considered within the best solution during the successes trials. The search process will stop until the maximum number of trial is reached.

4.1 Micro sine cosine procedure

The main task of this procedure is to achieve a refined local search space to enhance the final solution. The idea consists by dynamically adjusting the limits of control variables during search process. As well shown in Fig. 5, this routine allows the location of the best solution among many suboptimal solutions. The proposed procedure coordinated with the global search enhances the solution by performing smooth search around the near suboptimal solutions. The following points summarize the steps of the mechanism search of the proposed procedure:

  • Collect all suboptimal solutions named feasible regions

  • Rank the selected regions based on their fitness function

  • Select the best suboptimal solution, and update the lower limits of specified control variables

  • Select the worst region, and update the higher limits of specified control variables

  • Compare results, save all updated new control variables

  • Local search process stopped until a specified number of iteration is reached, in this study the number of iteration is fixed based on subregions chosen, Itreg \(=\) 4.

Fig. 5
figure 5

Mechanism search of micro sine cosine procedure

4.2 Parameters tuning

As well known, choosing feasible parameters is an important task to achieve the best solution during search process. Like many metaheuristic methods, Sin cosine algorithm requires setting specified parameters, in general, setting of these parameters depend on the nature and complexity of the problem to be solved. In this study, it is clearly found that an important constant coefficient ‘a’ and three control parameters known as r1, r2 and r3 must be dynamically adjusted during search process to balance between exploration and exploitation to escape from the local optimum. In this study, the number of search agents is taken 30, the maximum number of iterations is taken between 80 and 200 based on the complexity of the problem to be solved, and the three parameters r1, r2, and r3 are taken as follows:

$$\begin{aligned}&r_1 =a-it\times \frac{a}{it\,\mathrm{max}} \end{aligned}$$
(33)
$$\begin{aligned}&\hbox {with } a=2\times \left( {1-0.5\times \hbox {rand}\times \sin \left( {\frac{it}{it\,\mathrm{max}}} \right) } \right) \end{aligned}$$
(34)
$$\begin{aligned}&r_2 =2\times \pi \times \hbox {rand } \end{aligned}$$
(35)
$$\begin{aligned}&r_3 =2\times \hbox {rand} \times \hbox {abs}\left( {\sin \left( {\frac{\hbox {rand}}{wf}} \right) } \right) \end{aligned}$$
(36)

With, wf taken 100, the constant a is taken 2 only during the exploration stage at \(it\le itbase\).

5 Case studies and numerical results

Test System 1: IEEE 30 Bus

The first standard test system consists of 6 generating units located at buses: 1–2–5–8–11–13, four transformers located at lines 6–9, 6–10, 4–12 and 28–27 and nine shunt VAR compensation installed at buses 10, 12, 15, 17, 20, 21, 23, 24 and 29 [12, 17, 29]. To make flexible adjustment of reactive power exchanged between the compensators and the network, the nine shunt compensators are replaced with nine SVC devices. At normal condition, the total active and reactive load demand to satisfy are 283.4 MW and 126.2 MVAR, respectively. The technical data related to this test system are taken from [12, 17], and the minimum and maximum limits of voltages at control buses and load buses are taken 0.9 and 1.1 p.u, respectively. The minimum and maximum limits of tap transformers are 0.9 and 1.1 p.u, respectively. Various combined objective functions have been considered such as: fuel cost, power loss, voltage deviation, voltage stability and loading margin stability.

Scenario 1

The main objective of this first scenario is to identify the capability of the practical power system in terms of reactive power management. Multi-suboptimal solutions are dynamically generated based on different levels of GRMS.

Case 1

Generation of global database based on GRMS for power loss minimization.

In this case, the total power loss has been optimized using SCA at different levels of GRMS. All optimized control variables are saved in an initial database as well shown in Table 1, all security constraints are within the margin security. Figure 6 shows the evolution GRMS and CRMS for four levels, as well depicted in Table 1, and the best total power loss achieved is 2.9913 MW; this value is obtained at low security level (GRMS \(=\) 0.6338 p.u); however, the total power loss 3.3582 MW has been achieved at high security level (GRMS \(=\) 1.3598 p.u). This initial database will be used in the next stage to optimize the loading margin stability under contingency.

Table 1 Optimal setting of control variables: case 1: power loss optimization

Case 2

Generation of global database based on GRMS for voltage deviation minimization considering total power loss.

In this case, the total voltage deviation is also optimized using SCA. All suboptimal solutions found at different levels of GRMS are saved in an initial database. Figure 7 shows the evolution of GRMS and CRMS indices for four levels, as well depicted in Table 2, the best voltage deviation achieved is 0.2698 p.u, this value is obtained at high security level (GRMS \(=\) 0.9931 p.u). It is important to confirm that all security constraints are within their margin security. This initial database will be used in the next stage to optimize the loading margin stability under contingency.

Case 3

Generation of global database based on GRMS for voltage deviation minimization considering fuel cost.

In this case, the total voltage deviation is optimized in coordination with cost. All suboptimal solutions found at different levels of GRMS are saved in an initial database. Figure 8 shows the evolution GRMS and CRMS indices for four levels, as well depicted in Table 3, the best voltage deviation and total cost are 0.2453 p.u and 802.3510 $/h, respectively, this value obtained at high security level (GRMS \(=\) 0.9015 p.u).

Fig. 6
figure 6

Evolution of GRMS and CRMS: case 1

Fig. 7
figure 7

Evolution of GRMS and CRMS: case 2

Case 4

Generation of global database based on GRMS for power loss minimization considering fuel cost.

Table 2 Optimal setting of control variables: case 2: voltage deviation optimization

In this case, the total power loss is optimized in coordination with total fuel cost. All optimized control variables are saved in an initial database. The evolution of GRMS and CRMS indices at different levels is shown in Fig. 9. As well depicted in Table 4, the best total power loss and total cost achieved are 4.6819 MW, and 874. 23.37 $/h, respectively, and these values obtained at high security level (GRMS=1.2265 p.u). This initial database will be used in the next stage to optimize the loading margin stability under contingency.

Fig. 8
figure 8

Evolution of GRMS and CRMS: case 3

Table 3 Optimal setting of control variables: case 3: voltage deviation optimization considering fuel cost
Fig. 9
figure 9

Evolution of GRMS and CRMS: case 4

Scenario 2

The second scenario focused to demonstrate the superiority of the proposed security planning strategy-based interactive sine cosine algorithm to improve the solution of the standard OPF considering three objective functions such as total fuel cost, the total power loss and total voltage deviation, and these objective functions have been optimized individually and in coordination.

Case 5

Fuel cost minimization.

Table 4 Optimal setting of control variables: case 4: power loss optimization considering fuel cost

This first case of this second scenario focused on the minimization of the total fuel cost. The best total fuel cost optimized is 798.9513 $/h, and the corresponding power loss, voltage deviation and voltage stability index are 8.5950 MW, 1.9473 p.u, and 0.1264 p.u, respectively. Detailed results for optimal setting of control variables are shown in Table 5.

Case 6

Power loss minimization.

This case focused on the demonstration of the proposed planning strategy on the optimization of total power loss. The best total active power loss achieved is 2.8434 MW, which is better than the results of many papers cited in the literature [12, 17]. The convergence characteristic for total power loss minimization is shown in Fig. 10. Detailed results of optimal setting of control variables are depicted in Table 5, and all security constraints are within their admissible limits.

Table 5 Optimal setting of control variables cases: 5–6–7–8–9–10
Fig. 10
figure 10

Convergence characteristic: last stage, case 6

Case 7

Voltage deviation minimization.

This case focused on the minimization of the total voltage deviation. The best total voltage deviation achieved is 0.1172 p.u, which is better than the results found in many recent papers, cited in the literature, and the convergence characteristic for voltage deviation minimization is shown in Fig. 11. Detailed results of optimal setting of control variables are depicted in Table 5. All security constraints are within their admissible limits

Case 8

Voltage deviation and cost minimization.

In practical situations, it is useful to find the best compromise solutions between two objective functions. This case is investigated to optimize the total voltage deviation considering fuel cost. The best total voltage deviation achieved is 0.2455 p.u, which is higher than case 7; however, the total cost obtained is reduced to a lower value 802.3490 $/h. For this case, the voltage stability index achieved is 0.1493 p.u. All control variables and state variables such as reactive power of generating units, voltage magnitudes at load buses, and power transit in branches are within their security limits.

Fig. 11
figure 11

Convergence characteristic: last stage, case 7

Case 9

Power loss and cost minimization.

In order to show the relation between power loss and total fuel cost, the total power loss is optimized considering the generation cost. For this case, the total power loss optimized is 4.6824 MW, the optimized active power loss for this case is increased compared to case 6; however, the corresponding total fuel cost achieved is reduced to 874.2353. It is important to confirm that the optimal solution is achieved without violation of all control and state variables.

Case 10

Voltage stability index minimization considering total active power loss at normal condition.

Voltage stability is an important index which reflects the reliability of practical power system to deliver energy quality to consumer under disturbances such as load growth and faults at particular important branches. Therefore, the minimization of voltage stability index is a significant objective function. In this case, and by using the proposed algorithm, the voltage stability index is optimized in coordination with power loss. The voltage stability index is considerably decreased in this case to 0.1192 p.u compared to all cases (59). It is important to confirm that the optimized L_index value is achieved at lower total power loss (2.9536 MW), and the corresponding total fuel cost and total voltage deviation are 959.0448 $/h and 2.4338 p.u, respectively. It can be seen clearly that the voltage stability index is improved compared to all previous cases; thus, the distance from breakdown point is improved. The optimal control variables related to this case are depicted in Table 5, and it can be seen that all the control variables are within their upper and lower limits.

5.1 Comparative study

In order to evaluate the particularity and performances of the proposed planning strategy considering critical situations, it has been compared with various recent optimization algorithms. Table 6 shows a comparative study in terms of solution quality with several recent optimization methods. It is evident that the quality of results achieved using the proposed power system planning strategy-based modified sine cosine algorithm is better compared with many recently published OPF.

Table 6 Comparative study: best solutions: casees 5–6–7

Scenario 3

Security OPF considering loading margin stability with and without contingency

Case 11

Maximization of loading margin stability considering total loss without contingency.

The main objective function named loading margin stability is optimized considering the total power loss. The optimized loading margin stability achieved in coordination with power loss is 1.48796 p.u and 13.3120 MW, respectively, and the corresponding total voltage deviation and voltage stability index are 1.4773 p.u and 0.2002 p.u, respectively. Table 7 shows the setting control variables found associated with the best loading margin stability achieved in coordination with total power loss. Figure 12 shows the repartition of voltage magnitudes at all buses. All security constraints such as reactive power of generation units, voltage magnitudes, and power transit in branches are within their security limits.

Table 7 Optimal setting of control variables: cases: 11–12–13–14

Case 12

Maximization of loading margin stability considering voltage deviation without contingency.

In this case, the loading margin stability is optimized considering the total voltage deviation. The optimized loading margin stability achieved in coordination with voltage deviation is 1.480 p.u, 0.2771 p.u, respectively, and the corresponding total power loss and voltage stability index are 14.3232 MW and 0.2217 p.u, respectively; as we can see in Table 7, the total voltage deviation is improved compared to case 8. Table 7 shows the setting control variables found associated with the best loading margin stability achieved in coordination with total voltage deviation. The distribution of voltage magnitudes at all buses is shown in Fig. 12. Also for this critical case, all security constraints such as reactive power of generation units, voltage magnitudes, and power transit in branches are within their admissible limits.

Case 13

Maximization of loading margin stability considering total voltage deviation under contingency.

This case is investigated to validate the extensibility and efficiency of the proposed security planning strategy by maximization the loading margin stability considering total voltage deviation at critical situations such as contingency at specified branches. By considering contingency at branch 2–5, the total loading margin stability maximized to 1.24 p.u, and the corresponding total voltage deviation and total power loss achieved are 0.2505 p.u and 16.0968 MW, respectively. The distribution of voltage magnitudes at all buses is shown in Fig. 12. It is important to confirm that all security constraints are satisfied.

Case 14

Maximization of loading margin stability and minimization of total power loss under contingency.

This case is dedicated to show the impact of contingency on the optimized value of loading margin stability considering the total power loss of the system. By considering contingency at branch 2–5, the total loading margin stability maximized at 1.25 p.u, the corresponding total power loss and voltage deviation achieved are 14.9784 MW and 1.6720 p.u, respectively. The distribution of voltage magnitudes at all buses is shown in Fig. 12. It is important to confirm that all security constraints such as voltage magnitudes at all load buses, reactive power of generating units and power transit in branches are within their security limits. Figure 13 shows that the power transit magnitudes in all branches are within their security limits. for cases 11, 12, 13, 14.

Case 15

Maximization of loading margin stability and minimization of voltage stability under contingency.

This case focused to demonstrate the efficiency and particularity of the proposed planning strategy in solving security OPF under various practical and critical situations. For this case, the loading margin stability is optimized in coordination with voltage stability under severe contingency such as fault at the important branch (25). In such critical situation, it is important to maintain the voltage stability index at all load buses far from the breakdown point. Compared to all cases and in particular to case 13, the voltage stability index is improved to 0.1616 p.u at loading margin stability 1.25 p.u. However, the voltage deviation is increased to 1.6948 p.u compared to the optimized value 0.2505 p.u found at loading margin stability 1.24 p.u.

Fig. 12
figure 12

Voltage profiles: cases: 11–12–13–14

Fig. 13
figure 13

Power transit magnitudes (MVA): cases: 11–12–13–14

Test System 2: IEEE 118-Bus

The robustness of the proposed strategy is validated on a large practical electrical test system IEEE 118-bus. The network consists of 186 branches, 54 generator buses and 14 capacitor banks, and nine branches 8–5, 26–25, 30–17, 38–37, 63–59, 64–61, 65–66, 68–69, and 81–80 are tap changing transformers [12, 17, 28]. The total load demand to satisfy is 4242 MW for active power and 8777 MVAR for reactive power, the limits values of voltages for all generating units and tap setting transformer control variables are considered to be 1.1–0.9 in p.u, and the maximum and minimum values for voltages at all load buses are 1.1 and 0.9 in p.u, respectively. For this second test system, three objective functions are considered:

  • Case 16: Minimization of voltage deviation with and without SVC devices at normal condition

  • Case 17: Maximization of loading margin stability considering total power loss

  • Case 18: Maximization of loading margin stability considering total voltage deviation

Fig. 14
figure 14

Convergence characteristics (4 trials) for voltage deviation minimization without SVC devices: last stage: IEEE 118-Bus test system

Fig. 15
figure 15

Convergence characteristics (4 trials) for voltage deviation minimization with SVC devices: last stage: IEEE 118-Bus test system

Table 8 Optimized control variables for IEEE 118-bus system for case 17

Case 16

Minimization of voltage deviation with and without SVC devices at normal condition.

In this case, the voltage deviation is minimized at normal condition with and without the effect of SVC devices. The best voltage deviation found without considering the SVC devices is 0.4540 p.u, the corresponding power loss achieved is 10.5694 MW, and by considering installation of multi-SVC devices installed at specified locations, the value of voltage deviation improved to 0.4072 p.u, and the corresponding power loss is 10.0370 MW. Convergence characteristics for voltage deviation achieved at the final stage using the micro Sin Cosine procedure are shown in Figs. 14 and 15. It is seen from Figs. 14 and 15, that the near optimal solution is located within 10–20 iterations, thus justifying the choice of the maximum number of iteration of 50. Due to the interactivity aspect of the proposed local search procedure, only four trials are sufficient to locate the best solution among the suboptimal solutions. It is also important to confirm that all constraints variables such as reactive power of generating units, and power transit in branches are within their security limits.

Fig. 16
figure 16

Distribution of voltage magnitudes: case 17

Fig. 17
figure 17

Distribution of voltage magnitudes: case 18

Table 9 Optimized control variables for IEEE 118-bus system for case 18

Case 17

Maximization of loading margin stability considering total power loss.

In this case, the vector control considered consists of active power and voltage control for generating units, tap transformer, and reactive power of SVC devices. For this case, the loading margin stability is maximized considering total power loss. The total loading margin stability achieved is 1.585 p.u (6723.6 MW), and the corresponding total power loss and voltage deviation of the system are 46.8752 MW and 4.5311 p.u, respectively, without considering the SVC devices; however, by considering the integration of muti SVC devices at specified locations, the total power loss and voltage deviation are reduced to 43.9585 MW and 4.4239 p.u, respectively. All security constraints such as voltages at all buses, reactive power of generating units and power transit in branches are within their security limits. The distribution of voltage magnitudes at all buses is shown in Fig. 16. For this case, the optimized control variables with and without integration of SVC devices are depicted in Table 8.

Case 18

Maximization of loading margin stability considering total voltage deviation

In this case, the vector control considered contains active power and voltage control for generating units, tap transformer, and reactive power of SVC devices. For this case, the loading margin stability is maximized considering the total power loss. The total loading margin stability is achieved without considering the integration of SVC devices is 1.485 p.u, and the corresponding total voltage deviation and total power loss of the system are reduced to 1.5116 p.u and 38.4761 MW. By considering the integration of SVC devices at specified locations, and for the same loading margin stability, the voltage deviation improved to 1.0520 p.u, and the corresponding total power loss is 37.2839 MW. The distribution of voltage magnitudes at all buses is shown in Fig. 17. All security constraints such as voltages at all buses, reactive power of generating units and power transit in branches are within their security limits. For this case, the optimal control variables achieved with and without integration of SVC devices are depicted in Table 9.

6 Conclusion

In this paper, a novel optimization algorithm named interactive sine cosine algorithm is efficiently adapted and applied for solving the loading margin stability under contingency of practical power system. Firstly, in order to reduce the search space, the SCA is performed in parallel to locate the suboptimal solutions based on an initial database generated considering GRMS and CRMS indices. Secondly, the basic SCA is modified by dynamically adjusting particular parameters during search process to well creating balance between exploration and exploitation phases. The robustness of the proposed planning strategy in solving practical OPF problems is validated on a small and large test systems, the IEEE 30-Bus, and the IEEE 118-Bus considering load growth and contingency. Results found using the interactive SCA are competitive in terms of solution quality and convergence characteristics compared to the standard algorithm and to other recent methods. In the future and due to the efficient performances of the proposed power system planning strategy based interactive SCA, the authors will strive to adapt and apply the proposed algorithm for solving the dynamic OPF considering the ramp down and ramp up for large power system under critical situations considering the integration and coordination between different types of FACTS devices and renewable sources.