Introduction

In recent years, the applications of hybrid renewable energy sources have grown rapidly [1,2,3]. The main objective of studies related to hybrid systems is to improve the existing challenges stemming from the optimal sizing of hybrid equipment depending on load demand. Before implementing and installing the hybrid system equipment, it is necessary to determine its capacity using design methods in an optimal manner so as to obtain the capital cost and feasibility studies [4, 5]. Equipment sizing is basically the method of determining the capacity of the hybrid system equipment by minimizing the system cost while preserving the reliability of the load supply. A large size of the equipment will increase the system cost, while a small capacity; this may lead to a failure of the power-generation system to supply the load [4]. Various methods such as graphical structure, probabilistic approach, iteration-based method, and artificial intelligence (AI) have been used by previous studies to optimally design energy hybrid systems [1,2,3,4,5,6]. In the graphical structure method, the problem with two design variables can be solved by a graphical observation of how they change with respect to one another [6]. In [7], a method for optimal sizing of a solar–wind hybrid system is presented, where the optimal combination of the system is obtained by determining the amount of generation cost and the amount of system reliability constraint through preserving the capacity of wind generators and considering deficit power-hourly interruption probability (DPHIP) constraint.

In the optimal design of hybrid energy systems, which is an optimization problem with multiple factors, due to the complexity of the problem, conventional methods are incapable of solving the problem appropriately. For this reason, in recent years, the use of AI methods has been greatly welcomed. Reliability/cost assessment of solar–wind hybrid systems with a fuel cell system to minimize annual costs of the system plus the cost of load energy not supplied considering the reliability constraints of the probability of non-supplying the load has been studied using particle swarm optimization (PSO) algorithm [8]. The optimal size of a solar–wind hybrid system with fuel cell is presented using imperialist competitive algorithm (ICA) to minimize energy generation costs and the cost of load energy not supplied [9]. Design and management of solar–wind–fuel cell system as a case study for the city of Ardabil, Iran, are proposed using the flower pollination algorithm (FPA) with the aim of minimizing the net present value (NPV) and taking into account two reliability constraints at the same time, namely, loss of expected energy (LOEE), and loss of load expected (LOLE) [10]. The optimal design of a solar–wind–fuel cell hybrid system is presented in [11] using harmony search algorithm (HSA) to minimize the life-span cost by considering loss of power supply probability (LPSP). The artificial bee colony (ABC) algorithm has been used in [12] to find the optimal size of an independent solar–wind hybrid system based on a storage system by considering the LPSP reliability constraint. The optimal design of a solar–wind–battery hybrid system has been presented in [13] to minimize the annual energy generation costs by taking into account the reliability constraints of the probability of load energy not supplied using the genetic algorithm (GA). The obtained results show that by increasing the reliability of the system, the energy generation cost increases. The optimal design of solar–wind–battery hybrid systems with the aim of minimizing the annual costs of the system considering the power balance constraint was investigated in [14]. The purpose of this study was to determine the number of solar panels, wind turbines, and the number of batteries using the discrete harmonic search algorithm (DHSA). The optimal design of hybrid systems is provided by minimizing total costs and environmental pollution using GA [15]. In [16], the sizing of solar–wind hybrid systems by utilizing a battery bank with the objective of achieving the reliability constraint of desired load supply and the minimum annual system cost is presented using GA. In [17], a three-criterion optimization objective function with the minimization of total costs, environmental fuel emissions, and load power deficiency is proposed using Pareto-evolutionary algorithm to determine the optimal size of energy hybrid system. In [18], the combination of PSO algorithm and optimization constraints has been used to determine the optimal size of equipment of hybrid energy systems. In this study, the total system costs are considered as the objective function of the optimization problem and environmental pollution and load energy deficiency were taken into account as constraints. The optimal design of solar–wind–diesel hybrid energy system aiming at minimizing the annual costs of the system considering reliability constraints and fuel emission was performed in [19] using a pseudo-evolutionary algorithm. The authors of [20] used the big-bang (BB) algorithm to optimally design of a grid-independent solar–battery hybrid system with battery storage. In this study, the minimization of capital investment and repair and maintenance costs are considered as the objective function of the problem and a reliability index is assumed as the technical constraint of the problem. The optimal design of solar–wind–battery system using evolutionary algorithm (DA) has been studied by minimizing capital investment and repair and maintenance costs of equipment and the probability of not-supplied load constraint and the effects of the mentioned variations on the optimal size of equipment and the cost of the hybrid system have been evaluated [21]. In [22], the optimization of a solar–wind hybrid system with a battery bank has been investigated to minimize the annual cost of the system by considering the power balance constraint using the grey wolf optimizer (GWO) algorithm. In this study, the effect of equipment availability was evaluated by providing a reliability model [22]. The optimal design of a solar–diesel–battery system is presented using the cuckoo search algorithm (CSA) by minimizing the system power-generation cost and improving the reliability of the load [23]. In [24], the optimal design of a solar–wind–hydro system is presented based on the use of biogeography-based optimization (BBO) algorithm to specify the optimal size of the equipment.

Depending on the algorithm used to solve the design problem of a hybrid system, some of the advantages and disadvantages of these algorithms are described as follows. The GA is very suitable for optimization of problems with discrete quantities. However, when the search space is relatively small, the GA has a slower performance compared to some other similar methods [25]. Despite several benefits, such as sharing information between particles, high convergence rate, and better robustness against trapping at local optimal points, the PSO has disadvantages such as premature integration establishment and population diversity. The main disadvantage of the ICA is its dependence on the initial value of the parameters, and if an inappropriate amount is selected for the initial parameter, it will be trapped in the local optimum. The ABC, HSA, and CSA algorithms have suitable performance for solving optimization problems [25]. They also benefit high computational power and speed. Nevertheless, when the system under study is selected large and the number of optimization variables is high, these methods may become trapped in the local optimum and could not reach the global optimum [3, 4, 26].

From the above description, it is obvious that the competition is about using a method with high convergence accuracy and speed to achieve global optimum. On the other hand, an algorithm may well solve an optimization problem, but fail to solve another problem. As an appropriate solution, researchers examine different solving approaches of a problem to achieve a better solution. Therefore, selecting an appropriate algorithm with high precision and high convergence speed is very important for achieving the optimal size of hybrid systems. This has led to new opportunities for new optimization methods to be utilized in addressing a variety of problems and overcome the disadvantages of the conventional methods. On the other hand, the formulation of most of the reliability constraints used in designing hybrid systems has been implemented based on the concept of the power or energy associated with the load. To design the energy hybrid systems more precisely and to achieve a more reliable system, the concept of load interruption hours should also be considered in the formulation of reliability constraints and considering that it is possible to present the reliability constraint as a combination of power or energy concepts as well as load disruption hours. In addition, the problem of designing optimal solar–wind hybrid systems in a particular region requires the knowledge of sun radiation, temperature, and wind speed data in that area. Therefore, climatic conditions, including solar irradiation and wind speed in each geographic region, have a direct impact on the unit commitment of solar and wind power units in the hybrid system. Consequently, at first, feasibility studies should be made for each region.

In this paper, the optimal design of a PV/WT/Battery hybrid system is presented to minimize the NPCS with regard to hybrid constraint of deficit power-hourly interruption probability (DPHIP) for a case study in the city of Zanjan, Iran, for a 20-year study horizon. To determine the system parameters, including the optimal number of solar panels and wind turbines, the number of batteries, power transfer capacity of the inverter, solar array angle, and wind turbine height, a novel algorithm known as improved crow search algorithm (ICSA) has been introduced. The traditional CSA algorithm is inspired by the social behavior of crows in concealing their food. To improve the performance of the traditional CSA method, the mutation and crossover operators of GA method are employed to improve its performance in terms of increasing convergence speed, preventing trapping in local optima, and achieving accurate global optimum, based on which the ICSA algorithm is established. In the current research, the optimal design of the system in various combinations including solar–battery (PV/Batt) system, wind–battery (WT/Batt) system, and solar–wind–battery (PV/WT/Batt) system is performed considering the NPCS and DPHIP and the best combination for Zanjan is determined evaluating economic and technical indices. Moreover, in this paper, the effect of DPHIP constraint variations on the design of different system combinations is investigated. In addition, the capability of ICSA method in the design of hybrid systems is compared with a traditional CSA algorithm as well as with the PSO algorithm having high computational accuracy and power in solving optimization problems.

Consequently, the main contributions of this work can be listed as follows:

  1. 1.

    The optimal design of a hybrid system for Zanjan city to minimize the NPCS considering the DPHIP hybrid constraint

  2. 2.

    The use of ICSA meta-heuristic algorithm for designing the hybrid system

  3. 3.

    Determination of the best combination of an hybrid system for Zanjan based on the real data of solar radiation and wind speed

  4. 4.

    Comparison of capabilities of the ICSA method with well-known methods like PSO and CSA when designing the hybrid system

  5. 5.

    Investigation of the effects of DPHIP variations on system design, NPCS, and DPP.

Section 2 presents the case study and Sect. 3 describes the under-study renewable energy system that includes the configuration of the hybrid system and its operation and modeling. In Sect. 4, the objective function and problem constraints are defined in detail. The ICSA optimization method and its implementation steps in the design of the hybrid system are given in Sect. 4, and the simulation results are provided in Sect. 5. Section 6 of the paper summarizes the conclusions.

Case study: Zanjan City

Iran has a high potential for deploying a variety of renewable energy sources and implement hybrid energy systems. In this study, solar radiation and wind speed data of Zanjan were used to design a solar–wind–battery hybrid system and feasibility study on the implementation of renewable energy systems in this city was investigated. Zanjan city is located in the northwest of Iran in the Azarbaijan area, with (Northern) latitude of \( 36^{ \circ } 68^{{\prime }} \) and (Eastern) longitude of \( 48^{ \circ } 50^{{\prime }} \), and is 1650 m above sea level [27].

The studied renewable energy system

System configuration

The under-study hybrid energy system is a solar–wind system with battery storage (PV/WT/Batt), as shown in Fig. 1. The system includes PV arrays, wind turbines, and batteries (as a storage system for continuous load supply). The wind turbine is connected to a DC bus through an AC/DC converter. Moreover, PV arrays are connected to a DC bus via a DC/DC converter. The power of wind turbines and PV arrays are transferred to the load through the inverter. In this system, the battery is used to compensate for system load power deficiency and improve the system reliability.

Fig. 1
figure 1

Block diagram of the PV/WT/Batt renewable energy hybrid system

System operation

The operation of PV/WT/Batt energy system is such that the whole load is supplied (DPHIP = 0) when total generated power by solar arrays and wind turbines are equal to the load demand. In the case the overall generated power by PVs and wind turbines is greater than the load demand, the excessive power is injected into the battery and it will be in charging mode (DPHIP = 0). On the other hand, when the generated energy by PV and wind units is lower than the load demand, then the load deficiency is compensated by battery discharge. When the produced power by PVs and WTs as well as battery power are unable to fully supply the load, a part of the load is curtailed, and under such conditions, a reliability index is proposed as DPHIP index (\( 0 \le {\text{DPHIP}} \le 1 \)). DPHIP is a combined reliability index representing the probability of load deficit power to the total load power-hourly load interruption probability to the total load hours.

System equipment modeling

This section presents the modeling of all PV/WT/Batt system equipment.

Solar panel

In a solar panel, the total solar radiation on the skew surface is equal to the sum of irradiation, dispersed, and reflected components of the radiation hitting the surface. The dispersed and reflected components are neglected in this study, because they constitute only a minor part of the whole radiation [19]. Instantaneous radiation on a skew surface can be presented by the following equations. Equation (1) is used to calculate the solar deviation (\( \delta \)) through the earth deviation with respect to its rotation angle \( \theta \) (\( \theta = 23.44^{ \circ } \)) [19]:

$$ \delta = \theta \times \sin \left( {360^{ \circ } \times \frac{284 + n}{365}} \right), $$
(1)

where n is the number of days in a year.

Sun height angle (h), which is the angle between the sun path and horizon, can be approximated as follows [19]:

$$ \sinh = \sin \varphi \sin \delta + \cos \varphi \cos \delta \cos \tau $$
(2)
$$ \tau = \frac{360}{24}\left( {12 - lt} \right). $$
(3)

In the above equations, \( \varphi \) is the geographical latitude, \( \tau \) shows the hour angle and lt represents the local time (\( 0 \le lt \le 23 \)). According to Fig. 2, instantaneous radiation on the skew surface (St) can be obtained based on the horizontal component of the solar radiation (S) as follows [19]:

$$ S_{t} = \frac{S}{\sin \,h} $$
(4)
$$ S_{\rm {P}} = S_{t} \sin \left( {h + \beta } \right), $$
(5)

where SP is the effective component of the solar radiation perpendicular to the skew surface.

Fig. 2
figure 2

Schematic of solar radiation

Using the calculated SP, the maximum output power of PV panels is determined as follows:

$$ P_{\rm {PV}} = P_{{{\rm {PV}},{\text{Rated}}}} \eta_{{{\rm {PV}},{\text{mppt}}}} S_{t} \left( {\frac{{S_{\rm {P}} }}{1000}} \right), $$
(6)

where PPV,Rated is the rated power of each of PV panels and \( \eta_{\rm {PV,mppt}} \) denotes the maximum power point tracking (MPPT) efficiency. The value of 1000 in (6) represents the standard radiation on the PV panel surface.

Wind turbine

Power produced by a wind turbine in terms of wind speed is defined as follows [10]:

$$ P_{\rm {WG}} = \left\{ {\begin{array}{*{20}l} 0 \hfill & {v_{\rm {W}} \le v_{{{\rm {cut}}\;{\text{in}}}} ,v_{\rm {W}} \le v_{{{\rm {cut}}\;{\text{out}}}} } \hfill \\ {P_{\rm {WG,max}} \times \left. {\left( { \frac{{v_{\rm {W}} - v_{{{\rm {cut}}\;{\text{in}}}} }}{{v_{\rm {rated}} - v_{{{\rm {cut}}\;{\text{in}}}} }}} \right.} \right)^{m} } \hfill & { v_{{{\rm {cut}}\;{\text{in}}}} \le v_{\rm {W}} \le v_{\rm {rated}} } \hfill \\ {P_{\rm {WG,max}} + \frac{{P_{\rm {furl}} - P_{WG,{\rm {max}} } }}{{v_{{{\rm {cut}}\;{\text{out}}}} - v_{\rm {rated}} }} \times \left( {v_{\rm {W}} - v_{\rm {rated}} } \right)} \hfill & { v_{\rm {rated}} \le v_{\rm {W}} \le v_{\rm {furl}} } \hfill \\ \end{array} } \right., $$
(7)

where \( P_{\rm {WG}} \) is the output power of the wind turbine, \( v_{\rm {W}} \) is the wind speed, \( v_{{{\rm {cut}}\,{\text{in}}}} \) denotes the cut-in speed, \( v_{\rm {rated }} \) is the cut-out speed in m/s, \( P_{\rm {WG,max}} \) shows the maximum output power in kW, and \( P_{\rm {furl }} \) is the output power at the cut-out speed. Wind speed data are collected at 40 m height and the installation height of the turbine is 15 m. The wind speed at this height is calculated through the following equation [10]:

$$ v_{\rm {W}}^{h} = v_{\rm {W}}^{\rm {ref}} \times \left. {\left( { \frac{h}{{h_{\rm {ref}} }}} \right.} \right)^{\alpha } , $$
(8)

where \( v_{\rm {W}}^{h} \) is the wind speed at height h, \( v_{\rm {W}}^{\rm {ref}} \) is the wind speed at height \( h_{\rm {ref}} \) in m/s, and α is a parameter given in (3) and has a value between 0.14 and 0.25 [10].

Battery bank

In the given solar–wind hybrid system, the battery is used as a storage system. Charging and discharging strategy of the battery in energy oscillation management of renewable units for continuous load supply is as follows:

  • Battery charging mode

If the generated energy by the PV/WT/Batt system (the sum of power generation by solar arrays and wind turbines) is greater than the load demand at time t, the excessive energy is injected into the battery and stored at it. In charging mode, the amount of stored energy in the battery at time t is obtained as follows [28]:

$$ E_{\rm {Stor}} \left( t \right) = E_{\rm {Stor}} \left( {t - 1} \right) + \left[ {P_{\rm {PV}} \left( t \right) + P_{\rm {WG}} \left( t \right) - \frac{{P_{\rm {Load}} \left( t \right)}}{{\eta_{\rm {inv}} }}} \right] \cdot \Delta t, $$
(9)

where \( E_{\rm {Stor}} \left( t \right) \) and \( E_{\rm {Stor}} \left( {t - 1} \right) \) are storage energy of the battery at time steps t and t − 1, ∆t is the time interval (1 h), and \( \eta_{\rm {inv}} \) is the inverter efficiency.

  • Battery discharging mode

If the load demand is greater than the produced energy by the PV/WT/Batt system (the sum of generated power by solar arrays and wind turbines) at time t, the deficiency of load demand is compensated by battery discharge. In discharging mode, the amount of energy stored in the battery at time t is found as (10) as follows [28]:

$$ E_{\rm {Stor}} \left( t \right) = E_{\rm {Stor}} \left( {t - 1} \right) - \left[ {\frac{{P_{\rm {Load}} \left( t \right)}}{{\eta_{\rm {inv}} }} - (P_{\rm {PV}} \left( t \right) + P_{\rm {WG}} \left( t \right))} \right] \cdot \Delta t. $$
(10)

Objective function and problem constraints

The purpose of design is to determine the optimization variables including the number of solar arrays, wind turbines, batteries, inverter’s transfer power, solar panel angle, and the height of wind tower considering the objective function of minimizing NPCS and satisfying the reliability hybrid constraint, known as DPHIP. In this study, the data related to solar radiation and wind speed in Zanjan city are chosen for optimal design of the PV/WT/Batt system.

It should be noted that in optimal designing of hybrid energy systems, it is necessary to provide an optimization objective function and the other to provide a reliability constraint. In all hybrid system designing studies, the objective function is presented as an economic index that is, cost. And, the reliability constraint is also expressed as a technical index. The economic index refers to the cost of the net present cost of the load supply, as presented in Eq. (11). The technical index refers to the system load supply, which is presented in Eqs. (20) and (21).

Objective function

The optimal design problem of PV/WT/Batt system is presented based on both economic and technical indices. The optimal sizing of system equipment for achieving a cost-effective and reliable system is carried out taking into account these two indices. The objective function of the design problem is the minimization of NPCS, which is formulated as an economic index of the problem [10, 20]:

$$ {\text{Min}}\,{\text{NPCS}} = C_{\rm {cap}} + C_{\rm {main}} + C_{\rm {rep}} $$
(11)
$$ C_{\rm {cap}} = C_{\rm {PVc}} \times N_{\rm {PV}} + C_{\rm {WTc}} \times N_{\rm {WT}} + C_{\rm {Batc}} \times N_{\rm {Bat}} + C_{\rm {Invc}} \times N_{\rm {Inv}} $$
(12)
$$ \begin{aligned} C_{\rm {main}} &= {\text{PWA}} \times (C_{\rm {PVm}} \times N_{\rm {PV}} + C_{\rm {WTm}} \times N_{\rm {WT}} \\ &\quad+ C_{\rm {Batm}} \times N_{\rm {Bat}} + C_{\rm {Invm}} \times N_{\rm {Inv}} ) \end{aligned} $$
(13)
$$ {\text{PWA}}\left( {ir,R} \right) = \frac{{\left( {1 + ir} \right)^{R} - 1}}{{ir\left( {1 + ir} \right)^{R} }} $$
(14)
$$ ir = \frac{{ir_{\rm {nominal}} - f}}{1 + f} $$
(15)
$$ \begin{aligned} C_{\rm {rep}} &= K \times (C_{\rm {PVr}} \times N_{\rm {PV}} + C_{\rm {WTr}} \times N_{\rm {WT}} + \\&\quad+ C_{\rm {Batr}} \times N_{\rm {Bat}} + C_{\rm {Invr}} \times N_{\rm {Inv}} ) \end{aligned}$$
(16)
$$ k_{i} = \mathop \sum \limits_{n = 1}^{yi} \frac{1}{{\left( {1 + ir} \right)^{n \cdot Li} }}, $$
(17)

where NPCS is the net present cost of the PV/WT/Batt system. \( C_{\rm {cap}} \),\( C_{\rm {main}} \), and \( C_{\rm {rep}} \) are capital investment, maintenance, and repair costs of the equipment.\( N_{\rm {PV}} \), \( N_{\rm {WT}} \), \( N_{\rm {Bat}} \), and \( N_{\rm {Inv}} \) are the number of solar panels, wind turbines, batteries, and inverters. Moreover, \( C_{\rm {PVc}} \), \( C_{\rm {WTc}} \), \( C_{\rm {Batc}} \), and \( C_{\rm {Invc}} \) represent investment costs of equipment, \( C_{\rm {PVm}} \), \( C_{\rm {WTm}} \), \( C_{\rm {Batm}} \), and \( C_{\rm {Invm}} \) are the maintenance and operation costs of equipment, and finally, \( C_{\rm {PVr}} \), \( C_{\rm {WTr}} \), \( C_{\rm {Batr}} \), and \( C_{\rm {Invr}} \) are the replacement costs of equipment. R shows the life-span of the project (20 years in this study). ir is the real interest rate (6% in this study) obtained in terms of nominal interest ir nominal and annual inflation rate (f). PWA and K are the present value of annual and constant payment, respectively.

Constraints

In design studies for renewable energy systems, reliability indices such as power supply probability (PSP), loss of power supply probability (LPSP), and loss of load probability (LLP) are repeatedly presented as reliability constraints (technical design index), because a technical evaluation should be performed for the PV/WT/Batt system to meet the load demand. In this paper, deficit power probability (DPP) and also the hourly interruption probability (HIP) are simultaneously used as a reliability index for system design. DPP and HIP indices are defined as follows:

$$ {\text{DP}}\left( t \right) = \left[ {\frac{{P_{\rm {Load}} \left( t \right)}}{{ \eta_{\rm {Inv}} }} - P_{\rm {PV}} \left( t \right) - P_{\rm {WT}} \left( t \right)} \right] \cdot \Delta t - \left[ {E_{\rm {Bat}} \left( {t - 1} \right) - E_{{{\rm {Bat}} - { {\rm {min}} }}} } \right] \cdot \eta_{\rm {Bat}} $$
(18)
$$ E_{{{\rm {Bat}} - {\rm {min}} }} = \left( {1 - {\text{DOD}}} \right) \cdot E_{{{\rm {Bat}} - {\text{Max}}}} $$
(19)
$$ {\text{DPP}} = \frac{{\mathop \sum \nolimits_{t = 1}^{T} \left[ {{\text{DP}}\left( t \right)} \right]}}{{\mathop \sum \nolimits_{t = 1}^{T} \left[ {P_{\rm {Load}} \left( t \right)} \right]}} $$
(20)
$$ {\text{HIP}} = \frac{{\mathop \sum \nolimits_{t = 1}^{T} \left[ {{\text{Time}}\left( {P_{\rm {available}} \left( t \right) < P_{\rm {Load}} \left( t \right)} \right)} \right]}}{T}, $$
(21)

where DP(t) is the deficiency of power at time t, PLoad(t) is the load power at time t, Pavailable(t) is the injected power of the system by renewable units and battery bank to the load, and T is the total annual hours of the load, which is equal to 8760 h. DOD is the depth of discharge of the battery (80% in this case) [20]. The values of DPP and HIP can vary between 0 and 1. Zero means that the whole load is supplied from kW and time aspects, and 1 means that 100 percent of the total load has not been supplied from kW and time points of view. Therefore, in the design of the hybrid system for Zanjan city, both constraints are simultaneously applied to supply the load from kW and load hour points of view. For technical evaluation of the hybrid system design, the technical constraint of the reliability is presented according to the maximum DPHIP (DPHIPmax):

$$ {\text{DPHIP}} \le {\text{DPHIP }}^{\rm {max} } . $$
(22)

In addition, some of constraints related to the minimum and maximum capacities of the hybrid system equipment are as follows:

$$ N_{\rm {PV}}^{\rm {min} } \le N_{\rm {PV}} \le N_{\rm {PV}}^{\rm {max} } $$
(23)
$$ N_{\rm {WT}}^{\rm {min} } \le N_{\rm {WT}} \le N_{\rm {WT}}^{\rm {max} } $$
(24)
$$ N_{\rm {Batt}}^{\rm {min} } \le N_{\rm {Batt}} \le N_{\rm {Batt}}^{\rm {max} } $$
(25)
$$ P_{\rm {inv}}^{\rm {min} } \le P_{\rm {Inv}} \le P_{\rm {inv}}^{\rm {max} } $$
(26)
$$ \theta_{\rm {PV}}^{\rm {min} } \le \theta_{\rm {PV}} \le \theta_{\rm {PV}}^{\rm {max} } $$
(27)
$$ H_{\rm {WT}}^{\rm {min} } \le H_{\rm {WT}} \le H_{\rm {WT}}^{\rm {max} } , $$
(28)

where the minimum and maximum number of solar panels (NPV), wind turbines (NWT), batteries numbers (NBatt), the minimum and maximum capacities of the inverter (Pinv), angle of solar panels (θPV), and height of the wind tower (HWT) are constraints of the hybrid system designing problem.

Proposed method for solving optimization problem

The optimal design of PV/WT/Batt system based on economic and technical indices is a nonlinear optimization problem. A meta-heuristic method known as improved crow search algorithm (ICSA) has been used in this study to solve the mentioned problem, which will be described in the following subsection.

Crow search algorithm (CSA)

Crow search algorithm (CSA) is a meta-heuristic method inspired by intelligent behavior of crows, which was introduced by Askarzadeh in 2016 [29]. Since crows are voracious, they follow other crows in search of better quality food. Of course, finding the concealed food is not a simple task. If a crow follows another crow with the aim of discovering the hidden food, two phases are established on the basis of awareness probability. The first phase is when the crow is unaware of being followed by another crow, and as a result, the follower will discover the food cache. Consequently, the search process commences in a local area. The second phase is when the crow is aware of being followed by another crow or a flock of crows. In this case, a random position is established, where the search space occurs in a global area [29, 30].

If the number of crows is assumed to be N, then the position of crow i in the iteration iter will be a vector as \( X^{{i,{\text{iter}}}} \left( {i = 1,2, \ldots ,N;{\text{iter}} = 1,2, \ldots ,{\text{iter}}_{\rm {max} } } \right), \) where \( {\text{iter}}_{\rm {max} } \) is the maximum number of iterations and \( X^{{i,{\text{iter}}}} = \left[ {x_{1}^{{i,{\text{iter}}}} ,x_{2}^{{i,{\text{iter}}}} , \ldots ,x_{d}^{{i,{\text{iter}}}} } \right] \). It is assumed that the d dimension space includes the number of crows. One of the best experiences of the crow is stored in its memory. In the next iteration, the previous position is remembered and announced by \( m^{{i,{\text{iter}}}} \). Crows displace between the areas around themselves and search these areas to reach more food sources than the available food. Memory of crow j is updated when followed by crow i for discovering the food cache.

The CSA starts with a group of random solution. Then, the new position is created with help of awareness probability (AP) and the optimal solution is obtained by searching the problem space. Parameters of the CSA include flight length (FL) and AP. Two phases are defined in the CSA according to AP [29, 30]:

Phase 1 Crow j is unaware of being followed by crow i. As a result, crow i approach the food cache of crow j. In this phase, the new position of crow i is expressed as follows:

$$ x^{{i,{\text{iter}} + 1}} = x^{{i,{\text{iter}}}} + r_{i} \times {\text{FL}}^{{i,{\text{iter}}}} \times \left( {m^{{j,{\text{iter}}}} - x^{{i,{\text{iter}}}} } \right), $$
(29)

where ri is a random number with a uniform distribution between 0 and 1, and \( {\text{FL}}^{{i,{\text{iter}}}} \) is the flight length of crow i at iteration iter.

Phase 2 Crow j is aware of being followed by crow i. Hence, it attempts to deceive crow i by changing its position in the search space to protect its food source.

Therefore, phases 1 and 2 can be rewritten as follows:

$$ x^{{i,{\text{iter}} + 1}} = \left\{ {\begin{array}{*{20}l} {x^{{i,{\text{iter}}}} + r_{i} \times FL^{{i,{\text{iter}}}} \times \left( {m^{{j,{\text{iter}}}} - x^{{i,{\text{iter}}}} } \right)} \hfill & {r_{j} \ge AP^{{j,{\text{iter}}}} } \hfill \\ {{\text{a}}\;{\text{random}}\;{\text{position}}} \hfill & {\text{otherwise }} \hfill \\ \end{array} } \right., $$
(30)

where rj is a random number with a uniform distribution between 0 and 1, and \( {\text{AP}}^{{j,{\text{iter}}}} \) presents the awareness probability of crow j at iteration iter.

Improved CSA (ICSA) for optimal design of the system

In this study, crossover and mutation operators of GA have been used to improve the performance of the CSA method. CSA benefits a suitable capability of making a balance between exploration and exploitation, such that it explores the search space and exploits acceptable areas that have suitable solution. Nevertheless, in large-scale optimization problems, the CSA may be unable to reach a fast convergence and trap in local optimum. That is the reason why improved CSA (ICSA) has been presented. The ICSA method was introduced to overcome some challenges of optimization methods when the dimension of the problem increases and to achieve a faster convergence. Thus, the ICSA method has been proposed to ensure appropriate coverage of search space related to the range of optimization variables and reaching a suitable convergence of global optimum.

ICSA implementation flowchart for solving the design of the hybrid system based on economic and technical indices is given in Fig. 3. The steps of this implementation for solving the design problem and determining the optimal size of hybrid system equipment are as follows:

Fig. 3
figure 3

ICSA implementation flowchart for solving the problem

Step 1 Initialization of hybrid system data: In this step, solar radiation and wind speed data of Zanjan city as well as load demand information and economic and technical parameters of the design are applied to the program.

Step 2 Initialization of algorithm parameters: First, flock size (algorithm population), maximum number of iterations, FL, AP, crossover probability (Pc), and mutation probability (Pm) (based on trial and error and experience) are determined. In addition, the variables, i.e., the size of hybrid system equipment, are randomly determined for the algorithm population.

Step 3 Memory of every crow at the first iteration has been set randomly according to the estimation of its initial position.

Step 4 Calculation of the NPCS objective function for each member of the ICSA population: In this step, the value of the objective function is calculated for each member of the algorithm population (crows).

Step 5 Definition of the best member among the population: In this step, the values of the NPCS objective function for each member of the algorithm population are evaluated and a member (crow) with the minimum NPCS is selected as the best solution.

Step 6 Generation of a new position: In this step, crows establish new positions in the search space in case they are being followed. The obtained new position is determined according to Eq. (30).

Step 7 Feasibility study of new positions: Feasibility of new positions of crows is investigated. If the new position of a crow is feasible, then the crow updates its position; otherwise, it remains in the current position and will not move towards the new formed position.

Step 8 Calculation of NPCS for new positions of crows: The value of objective function is calculated for all new members of the updated population.

Step 9 Memory update: The following equation is used to update the memories of crows:

$$ m^{{i,{\text{iter}} + 1}} = \left\{ {\begin{array}{*{20}l} {x^{{i,{\text{iter}} + 1}} } \hfill & {f\left( { x^{{i,{\text{iter}} + 1}} } \right) {\text{is}}\;{\text{better}}\;{\text{than }}\;f\left( { m^{{i,{\text{iter}}}} } \right)} \hfill \\ {m^{{i,{\text{iter}} }} } \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right., $$
(31)

where \( f\left( { \cdot } \right) \) shows the value of objective function.

Step 10 Determination of the best solution: By evaluating and comparing the objective function in steps 6–9, the obtained solution will replace the solution of Step 5 if the former is better than the latter.

Step 11 Implementation of operators of GA method for algorithm population: In this step, crossover and mutation operators of GA method are used for all members of the CSA population to improve its performance, which includes preventing trapping in local optima and achieving the global optimum accurately. In this step, the best solution replaces the obtained solution from Step 10, in case the former is better than the latter.

Step 12 Have convergence conditions (achieving minimum NPCS (the best memory position) and execution of the maximum number of iterations for the algorithm) been verified? If yes, then go to Step 13, otherwise go to Step 6.

Step 13 Stop the algorithm and determine the best optimal variables corresponding to the best value of NPCS and print the results.

Results and discussion

System data

Solar radiation and wind speed data of Zanjan city [27], [31] are used for optimal design of hybrid PV/WT/Battery system. In Figs. 4, 5, and 6, experimental data of solar radiation and wind speed during a year related to the Zanjan along with the profile of a residential load are shown. The specification of the hybrid system is also presented in Table 1.

Fig. 4
figure 4

The annual solar radiation in Zanjan (2018)

Fig. 5
figure 5

The annual wind speed in Zanjan (2018)

Fig. 6
figure 6

The residential load in Zanjan (2018)

Table 1 The specification of the hybrid system

The lifetime of the PV/WT/Batt system and interest rate is 20 years and 6%, respectively [10]. The performance of the proposed algorithm in PV/WT/Batt designing is compared with conventional CSA and PSO algorithms. Each of the optimization methods is implemented 20-time independently in simulation environment. In this paper, the maximum population and the number of iteration of algorithms are considered 50 and 100, respectively. The decision variables include the number of wind turbines and the number of PV panels and number of batteries, the inverter capacity, the PV panel angle, and the height of the wind turbine tower. The maximum values of these variables are 1000, 1000, 1000, 50, 90, and 50, respectively, and their minimum amount is zero.

Results of hybrid system design for DPHIPmax = 1%

In this section, the results of hybrid system designing are presented for DPHIPmax = 1%. To evaluate the performance of the ICSA, the design of the hybrid system is carried out using CSA and PSO methods. The obtained results are presented in Table 2. The components optimal capacity along with the NPCS and the DPP and HIP indices are determined considering the maximum reliability index of DPHIPmax based on the proposed ICSA, CSA, and PSO methodology. According to Table 2, the optimal combination in view of lowest NPCS is PV/Batt system. In Fig. 7, the convergence curve of the PV/Batt system is shown using various optimization methods. As can be seen, the ICSA method achieves less cost than CSA and PSO methods and, in other words, converges to a smaller amount of NPCS. It can be seen that the improvement of the conventional CSA based on crossover and mutation operators of GA method reduced the convergence tolerance of the CSA method. Also, the convergence speed of the ICSA method is desirable compared to the other methods.

Table 2 Results of optimal design of hybrid combinations using different methods (DPHIPmax = 1%)
Fig. 7
figure 7

Convergence curve of optimization methods for PV/Batt system design (DPHIPmax = 1%)

According to Table 2, NPCS for the PV/WT/Batt system using ICSA, CSA, and PSO methods are 1.167, 1.292, and 1.175 M$, respectively, for the PV/Batt system for each method, the values are 1.166, 1.176, and 1.169 M$ and for the WT/Batt system for ICSA, CSA, and PSO methods, there are 3.636, 3.642, and 3.637 M$, respectively. According to the results, it is clear that the ICSA method in all of the system combinations has less NPCS than CSA and PSO methods. In addition, the results show that the ICSA method is achieved desirable reliability indices compared to the other methods. Another important result is that the results of the PV/Batt and PV/WT/Batt in view of NPCS are almost the same, and virtually no wind turbines are used in the best combination for power generation. This is due to the weak wind potential in Zanjan. In the combination of WT/Batt, which the program has to use wind turbines to supply, system costs have risen by more than 200%, due to the high utilization of the battery system due to its low wind potential in Zanjan. Therefore, implementation of energy system based on wind energy for Zanjan is not economical. The value of the DPP index, obtained using the ICSA, CSA, and PSO method, in PV WT/Batt system designing, is 0.0054, 0.0064 and 0.0056, respectively. The DPP index value is calculated using the ICSA, CSA, and PSO method in designing of the PV/Batt system, equal to 0.0053, 0.0055, and 0.0056, respectively. Also, the value of the HIP index is 87 h for the PV/WT/Batt system designing using the ICSA, CSA, and PSO method and for the PV/Batt system is 83 h.

In Fig. 8, the battery bank energy curve is plotted at DPHIPmax = 1% for the PV/Batt system using ICSA, CSA, and PSO methods. As can be seen, because of the greater solar radiation (as shown in Fig. 4), the reservoir energy is between hours 2000 and 7000 more than the other hours that this charged energy is discharged during times of shortage of power to improve load reliability.

Fig. 8
figure 8

Variations of the battery bank energy of PV/Batt system (DPHIPmax = 1%)

Results of hybrid system design for DPHIPmax = 3%

In this section, the results of hybrid system designing for DPHIPmax = 3% are presented. The optimal capacity of the components is presented in Table 3. The results show that, in this condition, the optimal and cost-effective combination is the hybrid systems without wind energy. The convergence curve for DPHIPmax = 3% in the PV/Batt composition is shown in Fig. 9. As can be seen, the ICSA method has more convergence speed and less convergence tolerance than CSA and PSO methods in achieving optimal solution.

Table 3 Optimal design results of hybrid system using different methods (DPHIPmax = 3%)
Fig. 9
figure 9

Convergence curve of optimization methods for PV/Batt system designing (DPHIPmax = 3%)

Table 3 shows the NPCS value for the PV/WT/Batt system using ICSA, CSA, and PSO methods that is 1.052, 1.061, and 1.054 M$, respectively, for the PV/Batt system, for each method, the NPCS values are 1.050, 1.053, and 1.051 M$; and for the WT/Batt system for the ICSA, CSA, and PSO methods, there are 1.398, 1.406, and 1.401 M$, respectively. According to the results, it is clear that the ICSA method in all of the system combinations has less NPCS than CSA and PSO methods. Similarly, the results of PV/Batt and PV/WT/Batt are roughly the same, and due to the low wind potential in Zanjan, wind turbines are not used in the best combination for energy generation. In addition, the cost of the system has increased in the combination of WT/Batt, which the program has to use with wind turbines to supply the load. The value of the DPP index, using the ICSA, CSA, and PSO method, in PV/WT/Batt, is 0.0179, 0.0187, and 0.0181, for PV/Batt is 0.0180, 0.0182, and 0.0182, and also for WT/Batt system, it is 0.0219, 0.0221, and 0.0220, respectively. In addition, the value of the HIP index is 262 h using the ICSA, CSA, and PSO method in PV/Batt system design.

In Fig. 10, the battery bank energy curve is illustrated at DPHIPmax = 3% for the PV/Batt system using ICSA, CSA, and PSO methods. In this situation, the CSA method has a higher level of storage, which is one of the reasons for increasing its cost over other methods.

Fig. 10
figure 10

Variations of battery bank energy of PV/Batt system (DPHIPmax = 3%)

Results of hybrid system design for DPHIPmax = 5%

In this section, optimized hybrid design results for DPHIPmax = 5% are presented. The results of the proposed ICSA method are compared with those of the CSA and PSO methods. Convergence curves for DPHIPmax = 5% for the PV/Batt system are shown in Fig. 11.

Fig. 11
figure 11

Convergence curve of optimization methods for PV/WT/Batt system design (DPHIPmax = 5%)

Table 4 shows that the combination of PV/Batt has the lowest NPCS and the best reliability index. For the PV/Batt system, the NPCS value is calculated using ICSA, CSA, and PSO methods equal to 1.0097, 1.0118, and 1.0105 M$, respectively. In optimizing the PV/WT/Batt system, it is also observed that the ICSA method supplies the load based on PV panels and batteries and does not use wind turbines in the design of the hybrid system. Therefore, the best combination of hybrid systems in DPHIPmax = 5% is also in conditions without using wind energy. The value of the DPP index using the ICSA, CSA, and PSO method in PV/Batt system design is 0.0326, 0.0338, and 0.0339, respectively, which indicates that the proposed method is more likely to deliver the load. Also, the value of the HIP index is 438 h, using the ICSA, CSA, and PSO method in PV/Batt system design. In all three modes of DPHIPmax, the optimal combination for the energy system is obtained hybrid system without wind energy. Also, the results indicate that the proposed method is superior to the optimal design of the system in different combinations than the other optimization methods.

Table 4 Optimal designing results of hybrid combinations using different methods (DPHIPmax = 5%)

In Fig. 12, the battery bank energy curve in DPHIPmax = 5% is plotted for the PV/Batt system using ICSA, CSA, and PSO methods. In this condition, the PSO method has more storage level.

Fig. 12
figure 12

Battery bank energy variation for PV/WT/Batt system (DPHIPmax = 5%)

Comparison the results due to different Variations

NPCS under conditions of DPHIPmax variations

The values of the NPCS in various combinations and different DPHIPmax are presented in Table 5. Also, in Fig. 13, the cost of different combinations of hybrid systems is shown in terms of the change in reliability index. The results indicate that PV/Batt is the best combination in view of NPCS. It is also observed that with reduction of the reliability index, the cost of the system is increased and vice versa. In addition, the results have confirmed the superiority of ICSA in designing the hybrid systems in comparison with the other methods. The results also showed that the cost of the WT/Batt system for DPHIPmax = 1% is increased significantly.

Table 5 NPCS values in different combinations of hybrid systems considering different DPHIPmax
Fig. 13
figure 13

Costs of different combinations of hybrid systems in condition of reliability constraint variations

DPP in terms of DPHIPmax variations

DPP values of different combinations in various DPHIPmax are presented in Table 6. Also, in Fig. 14, the DPP values of different combinations are shown in terms of the change of reliability constraints. The results show that the combination PV/Batt obtained from optimization methods has the lowest DPP. It is also observed that ICSA has less DPP than the other methods in different combinations. In addition, by increasing DPHIPmax, the DPP value is increased and vice versa.

Table 6 DPP values in different combinations of hybrid systems considering different DPHIPmax
Fig. 14
figure 14

DPP values of different combinations of hybrid systems in terms of changing reliability constraints

In Fig. 15, the curve of DPP percentage variations is presented yearly. As you can see, DPP values increase with DPHIPmax increasing and vice versa.

Fig. 15
figure 15

DPP variation curve in terms of DPHIPmax variations

Battery bank energy variations in different combinations

The battery bank energy variations for various combinations of the hybrid systems are presented in DPHIPmax = 1% in Fig. 16. As shown in Fig. 16, the storage level in the WT/Batt system is less than the other combinations, which is due to the poor potential of wind in Zanjan, which has led to an increase in WT/Batt costs compared to the other combinations.

Fig. 16
figure 16

Battery energy variations in different combinations in DPHIPmax = 1%

Energy management of hybrid system

In Fig. 17, the generated power curves of PV panels, wind turbines, load power, and DP are plotted. In the hybrid system designing, the load demand is supplied based on the generation of renewable resources along with battery storage to achieve a reliable system.

Fig. 17
figure 17

Hybrid PV/WT/Batt energy management in DPHIPmax = 1%

Sensitivity analysis

In the previous section, it was shown that the combination of hybrid PV/Battery system is the best option to implement the hybrid renewable energy systems in Zanjan. Therefore, in this section, the effect of variations in inverter efficiency, initial cost system, and load are investigated on the hybrid PV/Battery system.

Effect of inverter efficiency variations on the hybrid system designing

In this section, the effect of variations in inverter efficiency is studied. In the basic study, the inverter efficiency is considered 90%, where the effect of 95% and 100% efficiency is also evaluated on the hybrid system designing in this section. The simulation results are presented in Table 7. It can be seen that with increasing of the inverter efficiency, the reliability is improved (decreases DP) and also NPCS cost is declined. Therefore, the use of high-efficiency inverters reduces hybrid system costs for reliable load supply.

Table 7 Effects of inverter efficiency variations on hybrid system designing (DPHIP = 1%)

The effect of load variations on the hybrid system designing

The evaluation results of the load variations effects on the hybrid system designing are presented in Table 8. According to the results, with increased demand, the wind and PV power generation is increased. The amount of power transferred from the inverter to the load is also increased. As can be seen, with increasing the demand, NPCS is increased and vice versa. Therefore, the NPCS cost of PV/WT/Batt is increased due to demand increasing and to achieve optimal reliability. On the other hand, it is quite obvious that the NPCS is diminished by reducing the demand, generation capacity, and the storage system capacity.

Table 8 Effect of load variations on the hybrid systems designing (DPHIP = 1%)

Effects of initial cost system variations on the hybrid system designing

Variations in the initial investment cost of the storage system are evaluated in the designing problem and the results are presented in Table 9. In base state, the initial investment cost is 280$ per kWh. In this study, the hybrid system designing with an investment cost of 380$ and 480$ is also evaluated. The results showed that by increasing the investment cost, the level of power generation by renewable resources is increased and the level of storage is reduced. In the meanwhile, with the increase in the investment cost of storage system, its level of participation in load supply is reduced and this deficit is compensated by renewable sources. It can be seen that NPCS is increased with the increasing of storage system investment cost.

Table 9 Effect of variations in the initial investment cost of the storage system on the hybrid system designing (DPHIP = 1%)

Conclusion

In this paper, the design of an optimal hybrid PV/wind/battery system is presented for load demand considering actual data related to the annual solar radiation and wind speed in Zanjan, Iran. The optimum capacity of the hybrid system component is determined with the aim of minimizing NPCS and improving the reliability index (DPHIP) using the new ICSA meta-heuristic algorithm. The optimum capacity of the hybrid system components is presented in various combinations and in different amounts of DPHIP constraint. Simulation results showed that hybrid PV/Batt system compared to the other combination in terms of NPCS and DPHIP is more economical and more reliable for Zanjan city. The performance of the algorithm presented in this study is compared with the conventional CSA and PSO optimization methods. The obtained results showed that ICSA algorithm has more convergence speed, lower NPCS, and better reliability in designing different combinations of the hybrid systems. The results also showed that the cost of designing the WT/Batt system for Zanjan is higher than the other combinations and it is not economic that one of the important reasons is the weak wind potential in Zanjan city and the dependence of this combination to the high-level storage for load supply. In addition, effect of the important technical factors including the inverter efficiency variations and the investment cost of the storage system along with the load variations is evaluated on the hybrid system designing using the ICSA method. The results showed that increased inverter efficiency reduces NPCS and improves reliability. Increasing the storage investment cost increases the NPCS and undermines reliability. The NPCS is also increased with increasing the load demand.