1 Introduction

1.1 Motivation

In an attempt to reduce environmental pollution and distribution network technical indices, the use of local resources such as renewable energy sources (RESs) and non-RESs (NRESs), as well as local active loads (ALs) such as energy storage systems (ESSs) and demand response programs (DRPs), has increased throughout the network these days [1]. Put another way, by being dispersed as local resources, or ALs, at the distribution system level, these features not only enhance the environment but also the operation status, stability, security, and other things in the network [2]. However, two requirements must be met in order for these components to carry out their functions within the network: (1) proper management and synchronization with the distribution system operator (DSO) [3]; and (2) optimal positioning and dimensioning of these components to reduce installation costs of various sources and ALs [2]. To address the first demand, smart grid theory proposes controlling and coordinating many sources and ALs in the form of an aggregator, such a virtual power plant (VPP). The coordination abilities of sources and ALs are shown in [3, 4] as VPPs, indicating that the aggregate performance of sources and ALs has a greater impact on the improvement of the technical and financial conditions of the distribution network than do their respective contributions. Achieving criteria 1 and 2 necessitates planning VPPs in the distribution network, which allows for the determination of optimal locations and sizes for VPP components. However, one of the main issues with the electricity system that has been studied under the topic of network resilience is how to protect the network from natural disasters in order to minimize the significant financial and social losses that may result from them [5]. Because there is a chance that the N − k event may occur in the network, local sources should be particularly effective at reducing customer interruption durations in the case of a disaster; this is compatible with increasing network resiliency.

1.2 Literature review

Numerous studies have focused on the planning of sources and ALs in the distribution system. The writers in [6] construct the placement and sizing of distributed generators (DGs) from the perspective of commercial and private investors in the power system. To find the optimal solution, the authors describe the problem as nonlinear programming (NLP) and use the particle swarm optimization (PSO) technique. Ref. [7] illustrates the RES planning for the distribution network, which aims to ascertain the optimal location and dimensions of each RES. Notably, the DGs were planned in accordance with the modeling of the uncertainties associated with the demand and generation of renewable energy. This is due to the fact that the RESs generating power is usually proportionate to the solar radiation and wind speed uncertainty. This topic is stated as a two-objective optimization problem with the goal of reducing the annual planning cost and planning risk. This reference applies the Pareto optimization method based on a conventional non-dominant sorting genetic algorithm (NSGA) to find the optimal compromise solution. The simultaneous planning of DGs and ESSs by the active distribution network is described in [8]. The recommended strategy improves the network operational state more than planning for individual DGs or ESSs. In a distribution network with a high rate of photovoltaic penetration, the use of energy storage system (ESS) planning is detailed in [9]. The results of [9] make it clear that the strategy might improve not only the financial condition of ESSs but also the operational status and flexibility of the distribution network. It is critical to keep in mind that DGs are local sources that may be located where consumption occurs. As a result, in the case of a N − 1 occurrence, it is expected that they would reduce the shutdown that occurs after this event to maintain the necessary dependability for the power system. This has been investigated in regard to where distributed generators (DGs) should be placed in the distribution network [10], where the plan greatly improves system reliability. In order to reduce the amount of time that the distribution network shuts down in the case of N − k earthquake and flood-related catastrophes, it has also been studied where the DGs should be positioned ideally in [11]. In [11, 12], the uncertainties related to load, energy price, and network equipment availability are predicted using stochastic planning and hybrid stochastic-robust planning. Resiliency sources—that is, devices, sources, and ALs that successfully contribute to enhancing network resiliency against natural disasters—that can be utilized to increase network resiliency against natural disasters include strong distribution lines and substations, network reconfiguration programs, power electronics devices, DGs, and ESSs [11]. As in [11,12,13], reconfiguration planning, the best position for the DG, and robust distribution lines are used in [13] to improve network resilience. Furthermore, [14] evaluates the influence of power electronic devices on the condition of the specified index. The results presented in references [6] suggest that the configuration and size of local sources and ALs contribute to the overall technical condition of the network, encompassing its functionality, dependability, adaptability, and resilience. As a result, it is expected that the network will acquire the aforementioned functionalities through the implementation of these sources as VPP. It is worth noting that, as stated in [3, 4], the advantages of coordinating these components through VPP may not always be equivalent when managed individually. It has been effective in giving AL sources more financial returns via VPP than via their individual management, much like [3]. But be aware that most study has concentrated on how the power system operates, giving very little thought to where and how big VPPs should be placed. In an unbalanced active distribution network, VPPs function similarly to [15] in order to minimize energy losses, improve the voltage profile, and handle the unbalanced situation. Ref. [16] also presents a bi-level model for how VPPs operate in the active distribution network. The upper-level problem models the network's operation to reduce its operational expenses, while the lower-level problem formulates the VPP model intended to maximize the profit of the VPP in the circumstance of purchasing flexibility service. Referencing the securable-reliable operation (SRO) method, the probabilistic planning of distributed generators (DGs) and switched capacitive banks (SCBs) inside the reconfigurable distribution network is shown in Ref. [17]. In order to counteract the boundary mismatch between the models of the transmission and distribution systems that appears in the results of traditional power flow techniques, the transmission and distribution systems are analyzed comprehensively in [18]. A novel iterative master–slave splitting method is developed to solve the hybrid mixed power flow problem. Ref. [19] displays the dynamic generation and transmission expansion planning those accounts for switching capacitor bank allocation and demand response programs.

2 Research gaps

In line with the literature and referring to Table 1, it is observed that there are the following major research gaps in the planning of VPPs:

  • When planning, most studies consider the size and seating arrangements of ESSs and DGs separately. But in this case, all sources and storage devices should be under the control of the DSO. Under these conditions, the DSO's information processing speed will decrease, increasing the complexity of management and decision-making [3]. This issue could be resolved if sources and ALs are synchronized using VPPs. On the other hand, little information on the placement and measurements of VPPs can be found in the literature. Furthermore, [3, 4] claim that the combined architecture of aggregated sources and ALs delivers more desirable technical and financial advantages than these components' individual capabilities. If the aforementioned components participate in the electricity market, they will achieve more financial rewards in the form of VPP.

  • In order to enhance the resilience of the distribution system against natural disasters, the majority of research papers propose the reinforcement of the distribution network via the implementation of measures such as the fortification of substations and distribution lines. The cost associated with strengthening the distribution network is rather significant. Notably, because to their dispersion across the network, these components may serve a large number of its customers, reducing the frequency of interruptions caused by both external and internal issues. Therefore, by reducing interruptions brought on by natural disasters, VPP may successfully aid in boosting the resilience of the distribution network. It should be noted, however, that the use of VPP as a source of resilience in various studies has not received much attention.

  • Noted that the VPP planning in the distribution network is based on non-convex and nonlinear optimization model. To solve the nonlinear formulation by mathematical solvers, it should be converted to convex model. Because, the mathematical solvers for nonlinear problem is generally based on Karush–Kuhn–Tucker method. In this method, the model must be differentiable, which is not the case in the non-convex problem. Hence, it should be converted to linear model that is a convex formulation. In some studies (e.g., [11, 12]), a linear approximation model is provided for the problem; the optimal solution is then obtained by using conventional solvers (e.g., Simplex). This offers the advantage of quickly resolving the problem, but it has little bearing on the challenges of planning. Furthermore, there is a large computational error with this method. Moreover, a number of other studies, such as [6, 7], employ NHEAs to find the optimal solution. Furthermore, different solutions provide different responses. Consequently, the solution generated by these solvers has a low dependability coefficient. One way to demonstrate this would be to apply a mutation process to a genetic algorithm [20]. To improve the solution process by evolutionary algorithms, it is necessary to update the decision variables in different processes. This is accessible by hybrid algorithms.

Table 1 Pareto front for the proposed problem

2.1 Contributions

The position and quantity of VPPs within the distribution network are presented in this study, taking into account the network's limitations with regard to earthquake and flood resistance. This fills in the previously identified research gaps. The recommended technique in this study was adopted to compensate for the shortcomings in the literature on VPP issues. Utilizing a two-objective optimization framework, the plan aims to minimize the expenses associated with both VPP and EENS planning. The annual cost of constructing the various sources and ESSs in the VPP is included in the planning costs, in addition to the expected yearly operating expenditures of the NRESs and the purchase of electricity from the distribution network for the VPP. Power flow equations for the distribution network, the VPPs' planning and operation model, and operational and resilience constraints are other factors that affect the problem. The strategy also took into account uncertainties about demand, energy prices, the electricity generated by RESs, the availability of network hardware, and VPP components. Using SBM as a scenario reduction technique, a large number of scenarios are generated using RWM, and then a subset of those circumstances that are close to each other are selected. Finally, the contributions and objectives of the work are summarized as follows: 1) Optimal VPP size and location inside the distribution network, considering sources, ESSs, and the DRP, to optimize the technical and financial standing of the network and the VPP; 2) The use of VPP as a network-wide local resilience source to increase the distribution network's resistance to earthquake and flood damage; and 3) Locating the ideal solution with approximations of the ultimate unique answer using the hybrid CSA-SCA method (Fig. 1) [21].

Fig. 1
figure 1

The proposed framework for the VPP planning in the distribution network

2.2 Paper organization

The rest of the paper is organized in this manner. In Sect. 2, the proposed problem is presented and its stochastic modeling is explained. Section 3 presents the HMA-based approach to problem-solving. Lastly, the numerical results and conclusions are provided in Sects. 4 and 5, respectively.

3 Problem formulation

A microgrid is a small physical grid with interconnected loads and distributed energy resources within clearly defined electrical boundaries. The microgrid can connect or disconnect from the grid with a defined common point of coupling. A Virtual Power Plant is a network of decentralized power generation units, storage, and flexible loads. VPP is created using software to control and optimize generation and demand-side consumption and storage. The units are managed through a central control center of the VPP, but all the units remain independent in their operation and ownership. The main objective of a VPP is to ensure coordination between units of the plant in order to have an efficient system for the end-user and the utility.

This section outlines the planning model, including the location and scale of VPPs in the distribution network, with consideration given to the resilience of the network to earthquakes and floods. Consequently, the optimal alternating current power flow equations (AC-OPF) [22], the planning model of VPPs including various sources and ALs, and the annual planning cost of VPPs and the EENS imposed by the occurrence of natural disasters are utilized as two distinct objective functions that are contingent on network resilience. As a consequence, the optimization model for the scheme is as follows:

$$ \begin{aligned} \min \;Cost & = \sum\limits_{{i \in \Xi_{VPP} }} {\left\{ {\sum\limits_{{dt \in \Xi_{DT} }} {IC_{i,dt}^{DG} \overline{S}_{i,dt} } + \sum\limits_{{et \in \Xi_{ET} }} {IC_{i,et}^{ESS} \overline{E}_{i,et} } } \right\}} + 365 \times CP \\ & \quad \times \sum\limits_{{i \in \Xi_{VPP} }} {\sum\limits_{{h \in \Xi_{H} }} {\sum\limits_{{s \in \Xi_{SC} }}}}\\ & {{{\rho_{s} \left\{ {\lambda_{h,s} P_{i,h,s}^{VPP} + \sum\limits_{{dt \in \Xi_{DT} }} {\left( {\alpha_{i,dt} + \beta_{i,dt} P_{i,dt,h,s}^{DG} + \chi_{i,dt} \left( {P_{i,dt,h,s}^{DG} } \right)^{2} } \right)} } \right\}} } } \\ \end{aligned} $$
(1)
$$ \min \,\,\,\,\,EENS = OT \times CP \times \sum\limits_{{n \in \Xi_{N} }} {\sum\limits_{{h \in \Xi_{H} }} {\sum\limits_{{s \in \Xi_{SC} }} {\rho_{s} L_{n,h,s}^{NS} } } } $$
(2)

Subject to:

$$\begin{aligned}& L_{n,h,s}^{NS} + P_{n,h,s}^{St} - \sum\limits_{{i \in \Xi_{VPP} }} {I_{i,n}^{VPP} P_{i,h,s}^{VPP} }\\ & - \sum\limits_{{j \in \Xi_{N} }} {I_{n,j}^{Li} P_{n,j,h,s}^{Li} } = L_{n,h,s}^{P} \,\,\,\,\,\,\,\forall n,h,s\end{aligned}$$
(3)
$$\begin{aligned}& Q_{n,h,s}^{St} - \sum\limits_{{i \in \Xi_{VPP} }} {I_{i,n}^{VPP} Q_{i,h,s}^{VPP} }\\ & - \sum\limits_{{j \in \Xi_{N} }} {I_{n,j}^{Li} Q_{n,j,h,s}^{Li} } = L_{n,h,s}^{Q} \,\,\,\,\,\,\,\forall n,h,s\end{aligned}$$
(4)
$$\begin{aligned}& P_{n,j,h,s}^{Li} = G_{n,j}^{Li} \left( {V_{n,h,s} } \right)^{2} - V_{n,h,s} V_{j,h,s}\\ & \left\{ {G_{n,j}^{Li} \cos \left( {\delta_{n,h,s} - \delta_{j,h,s} } \right) + B_{n,j}^{Li} \sin \left( {\delta_{n,h,s} - \delta_{j,h,s} } \right)} \right\}u_{n,j,s}^{Li}\\ & \quad \forall n,j,h,s\end{aligned}$$
(5)
$$\begin{aligned}& Q_{n,j,h,s}^{Li} = - B_{n,j}^{Li} \left( {V_{n,h,s} } \right)^{2} + V_{n,h,s} V_{j,h,s}\\ & \left\{ {B_{n,j}^{Li} \cos \left( {\delta_{n,h,s} - \delta_{j,h,s} } \right) - G_{n,j}^{Li} \sin \left( {\delta_{n,h,s} - \delta_{j,h,s} } \right)} \right\}u_{n,j,s}^{Li} \\ & \quad \forall n,h,t,s\end{aligned}$$
(6)
$$ \sqrt {\left( {P_{n,j,h,s}^{Li} } \right)^{2} + \left( {Q_{n,j,h,s}^{Li} } \right)^{2} } \le \overline{S}_{n,j}^{Li} \, \,\,\,\forall n,j,h,s $$
(7)
$$ \sqrt {\left( {P_{n,h,s}^{St} } \right)^{2} + \left( {Q_{n,h,s}^{St} } \right)^{2} } \le \overline{S}_{n}^{St} u_{n,s}^{St} \, \,\,\,\forall n = {\text{Slack}}\,{\text{bus}},h,s $$
(8)
$$ V^{\min } \le V_{n,h,s} \le V^{\max } \, \,\,\,\forall n,h,s $$
(9)
$$ 0 \le L_{n,h,s}^{NS} \le L_{n,h,s}^{P} \,\,\,\,\,\,\,\forall n,h,s $$
(10)
$$\begin{aligned}& P_{i,h,s}^{VPP} = L_{i,h,s}^{P} - P_{i,h,s}^{DR} - \sum\limits_{{dt \in \Xi_{DT} }} {P_{i,dt,h,s}^{DG} }\\ & - \sum\limits_{{et \in \Xi_{ET} }} {\left( {P_{i,et,h,s}^{DIS} - P_{i,et,h,s}^{CH} } \right)} \, \, \, \forall i,h,s\end{aligned}$$
(11)
$$ Q_{i,h,s}^{VPP} = L_{i,h,s}^{Q} - \sum\limits_{{dt \in \left( {\Xi_{DT} - \Xi_{RES} } \right)}} {Q_{i,dt,h,s}^{DG} } \,\,\,\,\,\,\,\forall i,h,s $$
(12)
$$ P_{i,dt,h,s}^{DG} = \gamma_{i,dt,h,s}^{DG} \overline{S}_{i,dt} u_{i,dt,s}^{DG} \,\,\,\,\,\,\,\forall i,dt \in \Xi_{RES} ,h,s $$
(13)
$$\begin{aligned} &\sqrt {\left( {P_{i,dt,h,s}^{DG} } \right)^{2} + \left( {Q_{i,dt,h,s}^{DG} } \right)^{2} } \le \overline{S}_{i,dt} u_{i,dt,s}^{DG}\\ & \quad \, \,\,\,\forall i,dt \in \left( {\Xi_{DT} - \Xi_{RES} } \right),h,s\end{aligned}$$
(14)
$$ 0 \le \overline{S}_{i,dt} \le S_{i,dt}^{\max } \, \,\,\,\forall i,dt $$
(15)
$$ 0 \le P_{i,et,h,s}^{CH} \le \frac{{\overline{E}_{i,et} }}{{\tau_{i,et}^{CH} }}x_{i,dt,h} u_{i,et,s}^{ESS} \,\,\,\,\,\,\,\forall i,et,h,s $$
(16)
$$ 0 \le P_{i,et,h,s}^{DIS} \le \frac{{\overline{E}_{i,et} }}{{\tau_{i,et}^{DIS} }}\left( {1 - x_{i,et,h} } \right)u_{i,et,s}^{ESS} \,\,\,\,\,\,\forall i,et,h,s $$
(17)
$$\begin{aligned}& \upsilon_{i,et} \overline{E}_{i,et} \le \kappa_{i,et} \overline{E}_{i,et} + \sum\limits_{t = 1}^{h} {\left( {\eta_{i,et}^{CH} P_{i,et,t,s}^{CH} - \frac{1}{{\eta_{i,et}^{DIS} }}P_{i,et,t,s}^{DIS} } \right)}\\ & \le \overline{E}_{i,et} \,\,\,\,\,\,\forall i,et,h,s\end{aligned}$$
(18)
$$ 0 \le \overline{E}_{i,et} \le E_{i,et}^{\max } \,\,\,\,\,\,\forall i,et $$
(19)
$$ - \xi_{i} L_{i,h,s}^{P} \le P_{i,h,s}^{DR} \le \xi_{i} L_{i,h,s}^{P} \,\,\,\,\,\,\,\forall i,h,s $$
(20)
$$ \sum\limits_{{h \in \Xi_{H} }} {P_{i,h,s}^{DR} } = 0\,\,\,\,\,\,\,\forall i,s $$
(21)

The target functions of the presented issue are given by Eqs. (1) and (2). Equation (1) states that the VPP planning expenses for the distribution network should be kept to a minimum. The first part of this equation [2, 9] expresses the annual construction cost of distributed energy sources (DGs) and energy storage systems (ESS). It also shows the cost of installing different types of these sources and storage devices. The second part of the equation [1] displays the estimated annual operating costs of VPPs. Interestingly, the operational cost of a VPP with DGs and ALs is made up of the cost of fueling DGs (second term of the second line of Eq. (1)) and purchasing energy from the distribution network. The operational costs of ALs and VPPs are the same in the first term [1]. The following Eq. (2) [11, 12] provides the value of EENS acquired in the N − k event caused by the occurrence of earthquake and flood in the distribution network. Stated differently, a low number on the EENS index—which is employed in this paper to assess network resilience—indicates that a network is very robust to natural disasters. Constraints (3)–(9) represent the AC-OPF equations for the distribution network. They also display the balanced active and reactive power on each bus, (3)–(4); the active and reactive power flow through the distribution line, (5)–(6); the capacity limits of the substation and distribution line, (7)–(8); and the bus voltage magnitude constraint (9) [9, 11]. Constraint (8) is thus unique to this bus. Observe the voltage on this bus as well, which is fixed at a certain value and usually has a phase angle of 0 degrees and a magnitude of 1 p.u. [2]. Moreover, the resilience of the network is expressed by Eq. (10), which deals with the limitation of customer disturbance in the event of natural disasters [13]. While Eqs. (11)–(21) explain the balance of active and reactive power in VPPs, they also outline the operating model, the placement and size of DGs and ALs positioned within the VPP, as well as other planning limits for VPPs in the distribution network. According to IEEE1547 [4], it is thought that in this work, RESs are only used for power supply and ALs, like ESSs and DRPs, are only used for energy management in the VPP. The amount of active power generated by RESs is simulated using Eq. (13 [9]) using their power production rate and capacity. The power generation rate of renewable energy sources (RESs) is calculated in this research by dividing their capacity by their active power. While the capacity limit of NRESs is considered in Constraint (14) [1], the size limitation of DGs is provided in Eq. (15). These formulas state that it is both economically and resiliently feasible for the distribution network to place a certain kind of distributed generation (DG) in the VPP with a capacity of if the variable for that DG in the VPP has a value; if not, the selected site is not suitable for deploying the DG. Furthermore, the planning models for different ESSs are based on the limitations (16)–(19) [9]. For ESSs, there are typically two charging and discharging modes. When an ESS is in the charging mode, it takes in and adds active power to the network. Additionally, be aware that an ESS cannot operate in these two modes simultaneously [15]. Therefore, in the binary variable used in its modeling, x = 1 (0) indicates that the ESS is exclusively in the charging (discharge) mode. Besides, the energy stored in most ESSs increases in the charging mode, while in the discharge mode, the opposite occurs. Therefore, the energy stored in the ESS for h hours can be modeled by \(\kappa .\overline{E} + \sum\limits_{t = 1}^{h} {\left( {\eta_{{}}^{CH} P_{t}^{CH} - \frac{1}{{\eta_{{}}^{DIS} }}P_{t}^{DIS} } \right)}\), where \(\kappa .\overline{E}\) represents the initial energy of the ESS [9]. In the following, the limit of energy stored in the following restriction (18) shows the energy storage limit of the ESS, while (19) considers its size or capacity limit. These formulae state that the building site selected for the ESS is suitable if the ESS size is and the VPP has a value for that ESS type. Conversely, if it is 0, the selected location for the ESS is inappropriate. Finally, the DRP modeling of the VPP complies with constraints (20) and (21) [1]. This DRP uses an incentive-based strategy, wherein program participants consume more energy during off-peak hours when prices are lower and less during peak hours due to high energy costs.

The parameter of u refers to the availability of an element in the distribution network. In other words, if u = 1 for one of the mentioned elements, that equipment is linked to the network for the mentioned conditions; otherwise, it is disconnected from the network. Furthermore, the mentioned parameters and the load, LP and LQ, energy price, λ, and power rate of the RES, γDG, are uncertain. Therefore, stochastic programming is used in this study to reflect these uncertainties [23, 24]. In order to do this, RWM generates a number of scenarios, each of which has a probability value for the load and the energy price that is determined by the normal probability distribution function (PDF) [23]. Beta and Weibull PDFs are used to calculate the probability of RES power rate for photovoltaic (PV) and wind turbine (WT) types, respectively [3]. Bernoulli PDF is also used to calculate the probability values of parameters uLi, uSt, uDG, and uESS [11]. For example, \(\rho_{i,dt,s}^{DG} = \left( {1 - u_{i,dt,s}^{DG} } \right)F_{i,dt}^{DG} \left( {1 - F_{i,dt}^{DG} } \right)\rho^{0}\) can be used to calculate the probability of DG availability (ρDG) in a scenario [11]. In this relation, ρ0 indicates the probability of occurrence of a scenario in which no element of the network is disconnected, and it is proportional to Eq. (22).

$$\begin{aligned}& \rho^{0} = \left( {1 - F_{ref}^{St} } \right)\prod\limits_{{(n,j) \in \Xi_{N} }} {\left( {1 - F_{n,j}^{Li} } \right)}\\ & \prod\limits_{{i \in \Xi_{VPP} }} {\prod\limits_{{dt \in \Xi_{DT} }} {\left( {1 - F_{i,dt}^{DG} } \right)} } \prod\limits_{{i \in \Xi_{VPP} }} {\prod\limits_{{et \in \Xi_{ET} }} {\left( {1 - F_{i,et}^{ESS} } \right)}}\end{aligned}$$
(22)

where the parameter F refers to the forced outage rate (FOR) of the equipment in the event of flood and earthquake. It is worth noting that the values of parameters LP, LQ, λ, and γDG in every scenario are determined based on their mean and standard deviation [3], but the values of uLi, uSt, uDG, and uESS in each scenario are specified according to the FOR of the equipment [12]. In the end, this study uses the SBM as a scenario reduction technique to choose scenarios that are both likely to occur and close to one another. You may get more details about this technique in [23]. Stochastic modeling for uncertainty offers the following advantages over robust modeling: (1) It can accurately calculate some indices like reliability (because the accurate values of these indices are provided due to several scenarios of network equipment accessibility), and (2) Considering the probability of occurrence of a scenario.

4 Solution procedure

4.1 Extracting the single-objective model

Problem (1)–(21) is a two-objective optimization. To achieve the optimal solution by conventional solvers, a single-objective formulation of the problem is obtained using the ε-constraint-based Pareto optimization technique [25]. According to the proposed methodology, the single-objective model of formulations (1)–(21) would be similar to the problem provided by Eqs. (23)–(25), where the new problem's objective function is the decrease in the annual planning cost of VPP, as in Eq. (23). The upper limit, or EENS, restricts the second objective function (2), which deals with the minimization of EENS in the event of an earthquake and flood, in a manner similar to the limitation (24). Interestingly, regardless of whether Eqs. (1) or (2) are selected as the objective function in the new issue, the method is unconstrained and produces a unique solution in both cases [25].

$$ \begin{aligned} \min \;Cost & = \sum\limits_{{i \in \Xi_{VPP} }} {\left\{ {\sum\limits_{dt \in \Xi DT} {IC_{i,dt}^{DG} \overline{S}_{i,dt} } + \sum\limits_{et \in \Xi ET} {IC_{i,et}^{ESS} \overline{E}_{i,et} } } \right\}} \\ & \quad + \sum\limits_{{i \in \Xi_{VPP} }} {\sum\limits_{{h \in \Xi_{H} }} {\sum\limits_{{s \in \Xi_{SC} }}}} {{{\rho_{s} \left\{ {\lambda_{h,s} P_{i,h,s}^{VPP} + \sum\limits_{dt \in \Xi DT} {\left( {\alpha_{i,dt} + \beta_{i,dt} P_{i,dt,h,s}^{DG} + \chi_{i,dt} \left( {P_{i,dt,h,s}^{DG} } \right)^{2} } \right)} } \right\}} } } \\ \end{aligned} $$
(23)

Subject to:

$$ \sum\limits_{{n \in \Xi_{N} }} {\sum\limits_{{h \in \Xi_{H} }} {\sum\limits_{{s \in \Xi_{SC} }} {\rho_{s} L_{n,h,s}^{NS} } } } \le \varepsilon_{EENS} $$
(24)
$$ {\text{Constraints}}\;\left( {3} \right) - \left( {{21}} \right) $$
(25)

In (23)–(25), εEENS has a value between the minimum and maximum values of EENS function. The maximum value of this function is determined by minimizing the Cost function in the proposed scheme (problem with objective function (1) and constraint (25). Conversely, its minimum value is solely proportional to minimizing the EENS in the aforementioned scheme (problem with objective function (2) and constraint (25). This study uses the fuzzy decision-making (FDM) technique to find the best compromise solution for the functions specified [25]. Due to its reasonable accuracy and simplicity of use (the details of which are given in Algorithm 1), the approach is often used to solve multi-objective optimization problems.

Algorithm 1
figure a

Pseudocode of the FDM [25]

4.2 Problem-solving using the HMA

This section deals with the stated problem, (23)–(25), and how to address it using the HMA and a MINLP framework that combines elements of CAS [26] and SCA [27]. Since this strategy modifies the decision variables in two separate stages, it is expected to circumvent the limitations. This evidence is examined in subSect. 4.1 together with the previously outlined capabilities of HMA. Notice that in order to address the problem utilizing the previously mentioned HMA and even other NHEAs, the variables are divided into two categories: dependent and decision-making. The decision-making variables for suggested design include LNS, PCH, PDIS, PDG, and QDG associated with NRES, PDR, \(\overline{S}\), x, \(\overline{E}\) and their values, which are identified by the algorithm in proportion to the constraints (26)–(31). Dependent variables include PSt, QSt, PLi, QLi, PVPP, QVPP, PDG for RESs, V, and δ. To calculate these variables based on the values of the decision-making variables, the value of PDG is determined in proportion to RES by Eq. (13). The variables PVPP and QVPP will then be calculated applying constraints (11) and (12), respectively. Finally, the other dependent variables are calculated based on the power flow constraints, (3)–(6), which uses a backward-forward numerical technique [28] to solve these equations.

$$ L_{n,h,s}^{NS} \in Eq.(10)\,\,\,\,\,\,\,\forall n,h,s $$
(26)
$$ P_{i,dt,h,s}^{CH} \in Eq.(16)\,\,\,\,\,\,\,\forall i,dt,h,s $$
(27)
$$ P_{i,dt,h,s}^{DIS} \in Eq.(17)\,\,\,\,\,\,\,\forall i,dt,h,s $$
(28)
$$ P_{i,dt,h,s}^{DG} \in [0,\overline{S}_{i,dt} u_{i,dt,s}^{DG} ] \, \,\,\,\forall i,dt \in \left( {\Xi_{DT} - \Xi_{RES} } \right),h,s $$
(29)
$$ Q_{i,dt,h,s}^{DG} \in [0,\overline{S}_{i,dt} u_{i,dt,s}^{DG} ] \, \,\,\,\forall i,dt \in \left( {\Xi_{DT} - \Xi_{RES} } \right),h,s $$
(30)
$$ P_{i,h,s}^{DR} \in Eq.(20)\,\,\,\,\,\,\,\forall i,h,s $$
(31)
$$ \overline{S}_{i,dt} \in Eq.(15) \, \,\,\,\forall i,dt $$
(32)
$$ x_{i,dt,h} \in \{ 0,1\} \,\,\,\,\,\,\,\forall i,dt,h $$
(33)
$$ \overline{E}_{i,et} \in Eq.(19)\,\,\,\,\,\,\forall i,et $$
(34)

This study used the penalty function technique [29] to estimate the distribution network's operational limits, (7)–(9), the NRES's capacity limit, (14), the energy stored in the ESS, (18), and the DRP constraint, (21). The fitness function (FF) in this approach is equal to the objective function of the main problem (23), plus the total of the penalty functions (PeF) of the given constraints, as stated in (35). The penalty function for constraints a ≤ b and a = b are expressed as μ.max(0, a – b) and ϑ.(a – b), respectively, where μ ≥ 0 and ϑ ∈ (-∞, + ∞) represent Lagrange multipliers [14], which are considered in HMA as decision variables. Next, due to this topic, the PeF function for estimating constraints (7)–(9), (14), (18), and (21) is presented as Eq. (36) [30].

$$ \min \,\,\,\,\,FF = Cost + PeF $$
(35)
$$ \begin{aligned} PeF & = \sum\limits_{i,s} {\vartheta_{i,s} \left( {\sum\limits_{{h \in \Xi_{H} }} {P_{i,h,s}^{DR} } } \right)} + \mu^{EENS} \max \left( {0,\sum\limits_{{n \in \Xi_{N} }} {\sum\limits_{{h \in \Xi_{H} }} {\sum\limits_{{s \in \Xi_{SC} }} {\rho_{s} L_{n,h,s}^{NS} } } } - \varepsilon_{EENS} } \right) \\ & \quad + \sum\limits_{n,h,s} {\left\{ {\underline{\mu }_{n,h,s}^{v} \max \left( {0,V^{\min } - V_{n,h,s} } \right) + \overline{\mu }_{n,h,s}^{v} \max \left( {0,V_{n,h,s} - V^{\max } } \right)} \right\}} \\ & \quad + \mu^{St} \max \left( {0,\sqrt {\left( {P_{ref,h,s}^{St} } \right)^{2} + \left( {Q_{ref,h,s}^{St} } \right)^{2} } - \overline{S}_{ref}^{St} u_{n,s}^{St} } \right) \\ & \quad + \sum\limits_{n,j,h,s} {\left\{ {\overline{\mu }_{n,j,h,s}^{Li} \max \left( {0,\sqrt {\left( {P_{n,j,h,s}^{Li} } \right)^{2} + \left( {Q_{n,j,h,s}^{Li} } \right)^{2} } - \overline{S}_{n,j}^{Li} } \right)} \right\}} \\ & \quad + \sum\limits_{{i,dt \in \left( {\Xi_{DT} - \Xi_{RES} } \right),h,s}} {\left\{ {\overline{\mu }_{i,dt,h,s}^{DG} \max \left( {0,\sqrt {\left( {P_{i,dt,h,s}^{DG} } \right)^{2} + \left( {Q_{i,dt,h,s}^{DG} } \right)^{2} } - \overline{S}_{i,dt} u_{i,dt,s}^{DG} } \right)} \right\}} \\ & \quad + \sum\limits_{i,et,h,s} {\left\{ {\underline{\mu }_{i,et,h,s}^{ESS} \max \left( {0,\upsilon_{i,et} \overline{E}_{i,et} - \kappa_{i,et} \overline{E}_{i,et} - \sum\limits_{t = 1}^{h} {\left( {\eta_{i,et}^{CH} P_{i,et,t,s}^{CH} - \frac{1}{{\eta_{i,et}^{DIS} }}P_{i,et,t,s}^{DIS} } \right)} } \right)} \right\}} \\ & \quad + \sum\limits_{i,et,h,s} {\left\{ {\overline{\mu }_{i,et,h,s}^{ESS} \max \left( {0,\kappa_{i,et} \overline{E}_{i,et} + \sum\limits_{t = 1}^{h} {\left( {\eta_{i,et}^{CH} P_{i,et,t,s}^{CH} - \frac{1}{{\eta_{i,et}^{DIS} }}P_{i,et,t,s}^{DIS} } \right)} - \overline{E}_{i,et} } \right)} \right\}} \\ \end{aligned} $$
(36)

The decision variables of each phase are updated based on the best FF value from the step before it. At every update step in this research, the CSA procedure is carried out after the SCA process. Finally, it is thought that updating the decision variables up to a predetermined maximum number of iterations (Itermax) is how the proposed problem's convergence point is reached. In the end, you may utilize the CSA-SCA algorithm to get the optimal solution by following these steps:

  • Step 1: identifies N (population size) random values for decision variables including LNS, PCH, PDIS, PDG, and QDG for NRES, PDR, \(\overline{S}\), x, \(\overline{E}\), μ, and ϑ based on constraints (26)–(36), μ ≥ 0 and ϑ ∈ (−∞, + ∞).

  • Step 2: identifies the values of dependent variables based on constraints (3)–(6) and (11)–(13), and the value of the FF based on (35) for N values of decision variables, and then calculate the optimal value (the minimum based on (35)) of the FF.

  • Step 3: Terminate solving the problem if the convergence point is reached; otherwise, Step 4 will be performed. The convergence point is available when Itermax number of iterations is done for the decision variables updating steps.

  • Step 4: Update decision variables due to the optimal value of the FF in the previous step, where CSA updates first, and then SCA executes this process. Then go to Step 2.

The mathematical model in this study is based on the optimization formulation [31]. One element of an optimization model is an objective function [32]. The goal function contains a min (max) term to find the smallest (highest) value of this function [33]. It may be used to represent a function with one or more objectives [34]. Optimization issues have a variety of limitations [35]. Equality and inequality are defined as limitations [36]. The limitations apply to models that are mixed integer linear, mixed integer nonlinear, linear, or nonlinear [37]. To use the optimization model on a network or hybrid system, intelligent devices are needed. The core of smart systems is telecommunications equipment [38]. These systems coordinate the different power components. System processing is quick and network administration is easy under these conditions.

5 Simulation results

5.1 Case studies

The approach recommended in this section is used on the IEEE 69-bus radial distribution network, as shown in Fig. 2 [28]. The permitted bus voltage range is [0.9, 1.05] p.u. [39], while the network's base voltage and power are 1 MVA and 12.66 kV. Peak data and substation and distribution line parameters are given in [28]. Another way to get the daily load profile is to multiply the peak load factor [1] by the daily load coefficient curve (present in [1]) [40]. Furthermore, energy costs are estimated to be 16 $/MWh, 24 $/MWh, and 30 $/MWh for the off-peak, 1:00–7:00, middle-peak, 8:00–16:00, and 23:00–24:00, and peak, 17:00–22:00, periods [1]. It is expected that the coefficient of coefficient (CP) is 0.7 every year. Additionally, a 3-day outage time (OT) is allocated for earthquake and flood-related outages [11]. The construction costs of NRES, WT, and PV are 0.25 M$/MVA/year [39], 0.5 M$/MVA/year [39], and 0.75 M$/MVA/year [38]. The maximum capacity of each DG is 0.4 MVA. Specifically, NRES's fuel cost coefficients are $100, $20 $/MWh, and 0.003 $/MWh2, respectively. Ref. [41] also shows the daily active power rate curve for WT and PV. Furthermore, it is expected that consumers will participate in the VPP at a coefficient of 50% in the previously indicated DRP plan [3]. A battery in a variable power plant (VPP) may also have an initial energy of 10% of the battery capacity [42], a minimum storable energy of 10% of the battery capacity, a 95% charging and discharging efficiency, a maximum installed capacity of 2 MWh, and a charging and discharging duration of 2.5 h. Installing batteries costs 0.2 M$/MWh per year [40]. In addition to the previously listed items, it has been deduced from [11, 12] that earthquakes, floods, or both may affect busses 11–16, 19–22, 23–25, and 29–33, respectively.

Fig. 2
figure 2

IEEE 69-bus radial distribution network [28, 21]

5.2 Results

This study describes a problem formulation and solution technique that is coded in the MATLAB software environment. Below are the numerical findings that were obtained.

Determining the best compromise solution: The results of the Pareto front between the Cost and EENS functions in the proposed problem, (23)–(25), are shown in Fig. 3 and Table 1. The values of the Cost function that correspond to the lowest and highest values of EENS, zero and 226.5 MWh, respectively, are shown in this figure as 3.55 M$/year and 9.71 M$/year, respectively. The expense of investing in this will likewise be high. Figure 4 displays the results of FDM's selection of the best compromise option from the Pareto front. The results in this figure were obtained using the CSA-SCA, CSA, SCA, Teaching learning-based optimization (TLBO) [43], and differential evolution (DE) [44] solvers. N and Itermax were chosen 50 and 2000, respectively. Further possibilities for customizing the above algorithms are given in [26, 27]. For the 69-bus distribution network, models (23)–(25) estimate that the planning cost of VPPs under these conditions is 4.2955 M$/year, which is about 11.7% higher than its minimum value of 3.55 M$/year ((4.2955–3.55)/(9.71–3.55)). Furthermore, the EENS value now stands at 66.45 MWh, a deviation of around 30% from its lowest value. In addition, Fig. 3 shows that the HMA discussed above provides a superior solution than the NHEAs (CSA, SCA, TLBO, and DE) mentioned. Consequently, the HMA findings show better performance than the Cost and EENS functions that these methods give. They also found a convergence point after more than 975 iterations and more than 149 s of computation time. Nonetheless, the HMA's standard deviation, at 0.98%, is lower than the NHEAs'. Consequently, the dispersion of the final answer may be regarded as modest. It's crucial to remember that the term PeF/FF indicates how far the solution space of the suggested issue is stretched; if this happens, the problem's solution space will expand and the best solution will be discovered. Because of its low value of PeF/FF, Fig. 4 shows that the CSA-SCA technique has almost succeeded in finding the optimal solution for the given problem within the designated solution area [45, 46].

Fig. 3
figure 3

Pareto front curve for resiliency-based VPP planning

Fig. 4
figure 4

The best compromise solution between Cost and EENS obtained by different algorithms

In Table 2, to prove the first research gap in Sect. 1.3, the results of two nonlinear and linear models for the proposed design are compared. The proposed nonlinear model is presented in Sect. 2. In the linear model of the proposed design for the linearization of Eqs. (5) and (6) based on [11, 12], it is assumed that the voltage angle difference between the two buses at the beginning and end of the distribution line is less than 6 degrees. This is true in the distribution network. For the linearization of the second power of the voltage and the product of the voltage of different buses, the piecewise linearization technique is used, which is presented in [11, 12]. The linear model of these two relationships is presented in [11, 12]. The last part of relation (1) is also linearized using piecewise technique. Circular plates in constraints (7), (8) and (14) are approximated to the plate in a regular polygon format to access the linear model. This technique is described in [11, 12]. In constraints (16) and (17), there is a product of continuous variables (such as a) and binary variables (such as b), that is, c = a.b. To linearize this equation, two relations −M.(1 − b) ≤ c − a ≤ M.(1 − b) and −M.b ≤ a ≤ M.b are used, where M is a constant with a large value. Here, 5 pieces are used in the linear piece technique. A circular plane is approximated to a regular 90-sided plane. Finally, based on Table 2, it can be seen that the amount of calculation error for active and reactive power is around 5%, the calculation error of voltage in the linear model is around 1% compared to the nonlinear model. The error of power loss calculations is around 80%. Therefore, the linearization model of the proposed design has a significant calculation error compared to the nonlinear model for various variables such as power losses.

Table 2 Comparison of linear and nonlinear model results

B) Planning results of the proposed scheme: The results of the VPP planning in the distribution network, including the number and distribution of sources and ALs, are shown in Table 3. In order for this VPP to meet some of the demand from clients in these regions in the event of an earthquake or flood, it is generally suggested to build them in earthquake- and flood-prone areas. In this case, the low EENS rate is connected with Fig. 4 results, which demonstrate the network's exceptional resilience. Furthermore, since they are basically closed during business hours, VPPs are often reluctant to install PV. Despite WT's higher installation cost, its installation in VPP is more important than NRES's because of its insignificant operating costs. Moreover, NRES should be installed in VPP for the following two reasons: The WT installed in the VPP with the maximum capacity—0.4 MVA—indicated in paragraph 4.1 is unable to provide a significant portion of the energy needs of the VPP and the earthquake- and flood-prone areas. Second, it provides the VPP's only source of reactive power. Following that, high-capacity NRES were installed in buses 44, 49, and 56, which have significant active and reactive loads [13]. Despite this, they will be adopted in other VPPs due to the low reactive power supply capacity of the VPP. Regarding the ESS, it is also observed that ESS sizes are greater in VPPs with larger DG sizes due to the high load on these VPPs. Planning cost for the proposed scheme in the 69-bus network is reported in Fig. 5. According to this figure, the total investment cost of sources and storages is 3.4575 M$/year. Also, the total operation cost of sources is 0.838 M$/year. Finally, the total planning cost is 4.2955 M$/year for all VPPs.

Table 3 VPPs planning results constrained to the system resiliency in the 69-bus distribution network
Fig. 5
figure 5

Total cost of VPPs planning

C) Analysis of the resiliency and operation of the network: Figure 6 displays the values of EENS, annual energy loss (AEL), maximum voltage drop (MVD), and maximum overvoltage (MOV) for case studies I and II, which include the results of power flow analyses and the suggested plan. The EENS drops from 947.34 MWh in Case I to 66.45 MWh in Case II due to the success of the suggested plan, which entails the construction of a VPP in earthquake-affected and flooded districts. Consequently, it may lower the EENS by around 93% ((947.34–66.34)/947.34) as compared to power flow trials, improving network resilience by 93%. Case II has unquestionably caused the network's peak overvoltage to reach 0.0104 p.u., although this number is still below the permitted threshold of 0.05 (1.05–1) p.u. It is important to highlight that the value of loss of load (VOLL), which is the accepted definition of a penalty price, is strongly connected with achieving a low EENS or high resilience. Figure 7 shows the contours of resilience indices, such as EENS, and resiliency cost plus planning cost, or VOLL. The parameter VOLL (EENS) is shown in the figure, and the values of the aforementioned indices are calculated in reaction to changes in the VOLL value. Moreover, resilience costs the same as the product of VOLL and EENS, according to [11, 12]. To achieve a minimum EENS, the distribution network's VPP planning will be optimized. Furthermore, as Fig. 7 illustrates, the resilience cost increases to 20,000 $/MWh when the VOLL is raised. Consequently, under these circumstances, increasing the VOLL has a greater effect on the resilience cost than reducing the EENS. Nevertheless, increasing the VOLL from 20,000 $/MWh results in a decrease in the resilience cost. In the conclusion, it can be inferred from the results of this section that a sizeable yearly investment of around 91.71 million dollars is necessary to achieve 100% resilience. Figure 6 shows that an annual expenditure of 4.2955 M$ is required to achieve a 93% improvement in network resilience over the results of the power flow research. Based on EENS = 66.45, the VOLL for this example is 38,000 $/MWh, as seen in Fig. 7.

Fig. 6
figure 6

Value of operation and resiliency indices for the different cases, a EENS and AEL, b MVD and MOV

Fig. 7
figure 7

Resiliency and economic curve in VOLL including EENS, resiliency cost and planning cost

D) Investigating the performance of sources and ALs in the VPP: Figure 8 shows the estimated daily curve of active and reactive power of VPP components installed in the distribution network for the point that corresponds to the optimal compromise choice. The daily active power curve of ALs, such as DRPs and ESSs, is shown in Fig. 8. Consequently, as said in paragraph 4.1 (DRP power is negative), DRP members consume more energy during off-peak and mid-peak hours when energy prices are lower. This is also compatible with the circumstances that lead to improved resilience, as in the event of an earthquake or flood, a significant amount of the grid's energy demand must be supplied by high-power injections from local sources and ALs into the network. The figure illustrates that ESSs only perform charging operations between 1:00 and 7:00, which are off-peak hours. This is because these are the periods when energy prices are at their lowest, which decreases VPPs' operating expenses. Furthermore, it supplies power into the network or VPP between 13:00 and 00:00, or around 12 h, reducing the operating expenses of the EENS and VPP in the case of a flood or earthquake. According to subSect. 4.1, the cost of energy is 16 $/MWh during these hours, whereas the cost of NRES fuel is 20 $/MWh. In order to reduce the operating costs of VPPs, less electricity is thus obtained from NRESs during these hours. Additionally, it is not switched off during these hours in an attempt to reduce EENS. Nevertheless, high power is fed into both VPPs and EENS between the hours of 8:00 and 0:00, when the cost of NRES fuel is higher than the cost of electricity, in order to lower their operating costs. But be aware that because it also has to provide reactive power to the VPPs, a portion of its capacity, as shown in Fig. 8, is used to provide the reactive load of the VPPs. Consequently, they are unable to commit their whole capability to the generation of electricity from 8:00 to 0:00.

Fig. 8
figure 8

Expected daily curve of DRPs, ESSs and sources active power, and NRESs reactive power

6 Conclusion

This paper explains the placement and dimensions of VPPs in a distribution network constrained by flood and earthquake resistance. The proposed approach is a two-objective optimization technique, where the first objective function minimizes the earthquake and flood-related EENS produced by a N − k event, while the second one optimizes the VPP planning cost. The planning and operation model of VPPs, which includes RESs, NRESs, ESSs, and DRPs, power flow equations, and network operating and resilience constraints are all pertinent to the task. Finally, the optimal solution was achieved through the utilization of the HMA, an algorithmic combination of the SCA and CSA methods. The numerical results indicate that the HMA, which was previously mentioned, exhibits superior performance compared to NHEAs in both the number of convergence iterations and computation time. In addition, the response dispersion of HMA is relatively low at 0.98%, suggesting that it meets the approximate criteria for a unique response in the given context. In contrast to VPPs, WTs are more frequently deployed in areas prone to earthquakes and flooding due to their superior power generation capability and reduced operating expenses in comparison with alternative DGs. Obtaining these terms will incur a penalty fee of $38,000 per megawatt-hour, or VOLL. The planning and operation of VPP is the distribution network can be improved the resiliency and operation states of network. So that indices of operation and resiliency improved about to 93% with respect to load flow analysis.

The outage time must be considered as an uncertain parameter with an appropriate probability function. This issue is considered as the future work.