1 Introduction

Using of renewable energy has grown exponentially. Different countries, considering their industrial capabilities and geographical potentials, are trying to benefit from these resources. The share of new energy in the budgets of developed countries is increasing [1, 2]. One of the most important goals of using renewable energy sources is to reduce costs. The use of renewable energy sources is a good way to supply electricity consumption of remote areas to reduce the economic costs of expanding and transferring network lines, reduce environmental pollution and increase energy effectiveness [1, 2]. The most important sources of distributed generation (DG) based on renewable energy are photovoltaic (PV) arrays and wind turbines (WTs). Power generation systems that include different energy resources are named "hybrid" systems because they have more than one energy source to supply AC or DC loads [3]. Evaluating the economic income due to the use of the renewable energy sources in hybrid systems requires examining the level of system reliability, which due to the uncertainty of the renewable resources generation, the need for reliability studies in the hybrid system is more felt [4, 5]. So, in the system design, the optimal size of the renewable resources with storage system should be determined with minimizing the system cost and also satisfying the load reliability level [6].

Some researches are conducted on stand-alone system design. The PV/WT/fuel cell system design is presented to reduce the annual costs considering load interruption probability via improved sine–cosine algorithm (ISCA) and particle swarm optimization (PSO) method in [7] and using an imperialist competitive algorithm (ICA) in [8]. In [9], economical and reliable designing of the PV/WT/Hydrogen system is developed with the aim of reducing the net present cost and providing a combined constraint of reliability for the Ardabil region of Iran. In [10], designing the hybrid system is evaluated based on PV and battery storage as grid-connected with the capability of grid import and export using linear programming (LP). The hybrid PV/WT/Tidal/Hydrogen system design is studied with the aim of evaluating cost/reliability based on whale optimization algorithm (WOA) based on reliability constraint in [11], using discrete harmony search algorithm (DHSA) in [12]. In [13], designing of different hybrid system based PV, WT, Batt and grid are presented economically and technically and the optimization problem is solved using non-dominated GA for household application. In [14], PV/WT/Batt system design is developed and aimed at minimizing the net present cost considering the reliability constraint using the improved crow search algorithm. The hybrid PV/WT/Batt system design is implemented with annual cost minimization and reliability enhancement by Grey Wolf optimizer (GWO) in [15]. These studies show that using a powerful optimization method, sizing of the components can be found in such a way that the lowest cost is achieved with the best reliability. Moreover, with the increasing demand for wind and PV energy, the fluctuations of their output power have created a great challenge for reliable and economical operation of energy systems and load supply based on these types of systems. Therefore, uncertainty assessment due to the fluctuation and unpredictability of PV and wind energy sources in hybrid energy systems is necessary for accurate cost and reliability calculations and is also inevitable for decision-makers of power systems [16, 17]. Various methods for estimating the uncertainty have been reported in previous studies, including robust optimization (RO), distance-based analysis, probabilistic method (PM), feasibility method, hybrid possibility-probability method (HPP), and information gap decision theory (IGDT) [16, 17]. One of the common methods of modeling uncertainty is the Monte Carlo simulation (MCS). The MCS is one of the most accurate and common random methods [16]. Limited studies have been addressed on the use of PV and wind energy sources due to uncertainty. The annual PV energy estimate is presented in [18], considering the uncertainty of energy generation. In [19], changes and predictions of PV power system uncertainty in Arizona, USA have been investigated as the main challenge for operators to maintain power balance and costs minimization. In [20], the effect of uncertainty in load demand and energy resources on the economic and technical performance of hybrid PV and combined cooling, heating (CCHP + PV) systems are evaluated. In [21], a method for estimating the PV power uncertainty and identifying methods is presented to reduce uncertainty. In [22], the analysis of energy uncertainty for WTs has been done based on the MCS and the effect of practical parameters with uncertainty has been evaluated on wind farm power generation. In [23], a comparison of uncertainty's importance degree in calculating wind power is presented considering the technical parameters of wind speed and wind tower height based on time series. In [24], a probabilistic power model of WTs is proposed to determine the uncertainty of wind energy conversion system based on wind speed changes using MCS.

As can be seen from previous research, most studies of stand-alone hybrid systems designing are presented as deterministic and without considering the uncertainty of renewable energy resources generation and also load demand. So, due to continuous changes in the load demand and also changes in the renewable power generation, the designing of the hybrid systems should be performed considering the uncertainties of the generation and load to achieve accurate values of the cost and reliability.

In this paper, grid-off hybrid PV/WT/Batt system designing is presented with the uncertainty of photovoltaic and wind power generation and load demand using radiation and wind speed real data in Zanjan region, Iran country. The objective function is defined as minimizing the total cost of the hybrid system (TCHS) includes the net present cost as well as the cost of load losses. Also, the reliability constraint is presented as deficit power probability probability-hourly interruption probability (DPPHIP) index. Improved crow search algorithm (ICSA) inspired based on crows' food search behavior and enhanced using genetic algorithm operators that this algorithm is applied for the optimal design of the hybrid system [25, 26]. First, the designing problem is solved as deterministic and then the probabilistic approach based MCS is implemented using renewable generation power and system load demand. The designing results including the optimal size of the components and the optimal cost and reliability values are evaluated in comparison with conventional CSA and PSO methods [27]. In deterministic designing, the effect of considering the cost of load loss is investigated on system designing. Moreover, the results of deterministic and probabilistic hybrid system designing are compared.

In Sect. 2, the modeling of the hybrid system is presented. In Sect. 3, the problem formulation is described. The proposed meta-heuristic approach and implementation process are described in Sect. 4. In Sect. 5, the results are presented and also discussed. Section 6 given the conclusion.

2 Hybrid system modeling

The PV/WT/Batt renewable system is considered as a hybrid energy system that includes WT, PV panel, battery, DC/DC converter, AC/DC converter, and also inverter. Schematic of hybrid PV/WT/Batt renewable system is showed in Fig. 1. The battery is used to enhance the system's reliability.

Fig. 1
figure 1

Schematic of hybrid PV/WT/Batt renewable system

In the hybrid PV/ WT/Batt system, the battery is charging when the power of the renewable resource is higher than the load level. When the generated power of the renewable units is less than the load demand, the battery is in discharge mode. Of course, under equal conditions of generation and consumption, battery energy is unchanged.

2.1 Hybrid system contribution

The global energy charter is a guide to sustainable energy implementation that includes better legislation, increased efficiency of energy systems, renewable energy solutions, financing, and community educational and behavioral goals. The main goals of the global energy charter for sustainable development are reducing atmospheric emissions and establishing international, regional, and national programs to improve energy efficiency, controlling energy safety, and managing waste. It is predicted that with the creation of energy crisis in the world and depletion of non-renewable energy sources, as well as increasing the level of environmental pollution, it is necessary to use renewable energy to generate electricity. With the growth of technologies in sustainable energy resources, continuous reduction of non-renewable energy reserves, and also free availability of the renewable energy resources (solar, hydro, wind …) in Iran country, architects and designers can apply a desirable design according to climate and environment conditions.

2.2 PV model

The generated power of PV panels due to the horizontal component of PV radiation (S) and the PV angle relative to the horizon (\({\theta }_{PV}\)) is defined by [27].

$${P}_{PV}={P}_{PV,Rated}{\eta }_{PV,mppt}\left(\frac{\mathrm{sin}\left(\mathrm{h}+{\theta }_{PV}\right)}{1000}\right) \cdot \left(\frac{\mathrm{S}}{\mathrm{sin}h}\right)$$
(1)

where, \({P}_{PV,Rated}\) refers to the rated power of each panel, \({\eta }_{PV,mppt}\) refers to MPPT efficiency, the value of 1000 indicates the amount of standard radiation at 25° C, h indicates angle between the radiation path and the horizon and S is the horizontal component (W/m2).

In this study, the uncertainty of PV irradiance is considered in the design of hybrid systems. To model the uncertainty, the beta probability distribution function is used as follows [21, 28]:

$$f_{b} \left( s \right) = \left\{ {\begin{array}{*{20}l} {\frac{{\Gamma \left( {\alpha + \beta } \right)}}{{\Gamma \left( \alpha \right)\Gamma \left( \beta \right)}} \times s^{{\left( {\alpha - 1} \right)}} \times \left( {1 - s} \right)^{{\left( {\beta - 1} \right)}} } & {for} & {0 \le s \le 1,~~\alpha ,~\beta \ge 0} \\ 0 & {} & {otherwise} \\ \end{array} } \right.$$
(2)

where, \(\mathrm{S}\) is the irradiance, fb(s) is the beta probability distribution function for the variable s, α and β are the beta distribution parameters and are calculated as follows.

$$\beta =\left(1-\mu \right)\times \left(\frac{\mu \times (1+\mu )}{{\sigma }^{2}}-1 \right)$$
(3)
$$\alpha =\frac{\mu \times \beta }{1-\mu }$$
(4)

where, μ and σ are the mean and deviation from the criterion of this distribution, respectively.

2.3 WT model

Wind turbine output power in terms of wind speed (\({v}_{W}\)), low cut-off speed (\({v}_{cutin}\)), high cut-off speed (vcut out), rated speed (\({v}_{rated}\)), is defined as follows [29]:

$$P_{{WG}} = \left\{ {\begin{array}{*{20}c} {0\;;} & {v_{w} \le v_{{cut\;in}} ,\;v_{w} \; \ge \;v_{{cut\;out}} } \\ {P_{{WG,\max }} \times \left( {\frac{{v_{w} - v_{{cut\;in}} }}{{v_{{rated}} - v_{{cut\;in}} }}} \right)^{m} \;;} & {v_{{cut\;in}} \le v_{w} ,\;v_{{rated}} } \\ {P_{{WG,\max }} + \left( {\frac{{p_{{furl}} - P_{{WG,\max }} }}{{v_{{cut\;out}} - v_{{rated}} }}} \right) \times \;\left( {v_{w} - v_{{rated}} } \right)\;;} & {v_{{rated}} \le v_{w} ,\;v_{{furl}} } \\ \end{array} } \right.$$
(5)

where, \({P}_{WG}\) indicates the WT output power, \({P}_{WG,max}\) refers to the maximum power in kilowatts and \({P}_{furl}\) is output power at high cut-off speed.

Wind speed changes due to the height of the wind tower should be considered in the design of WTs. In this study, the power law is used to transfer anemometer data at a certain height and the relationship of this model is as follows [9].

$$v_{W}^{h} = v_{W}^{{ref}} \times \left. {\left( {~\frac{{h_{{wg}} }}{{h_{r} }}} \right.} \right)^{n}$$
(6)

where, \({v}_{W}^{h}\) is wind speed at the height of \({h}_{wg}\) is wind tower, \({v}_{W}^{h}\) is measured wind speed at the reference height (hr), n is the coefficient of the law of wind speed power, which is usually equal to \(\frac{1}{7}\) for relatively smooth surfaces [29].

In this study, wind speed uncertainty and wind power are considered in the design of the hybrid system. To model wind power uncertainty, the most suitable PDF is the Weibull distribution function, so for wind speed, the Weibull PDF is used as follows [30,31,32,33,34,35]:

$$f_{{v_{W} }} \left( {v_{W} } \right) = \frac{b}{\eta }\left. {\left( {~\frac{{v_{W} }}{\eta }} \right.} \right)^{{b - 1}} e^{{ - \left( {\frac{{v_{W} }}{b}} \right)^{b} }}$$
(7)

where, \({v}_{W}\) is the wind speed, and η and b are the scale parameter and the shape parameter, respectively.

2.4 Battery banks

The PV/WT/Batt system design, the battery based on charge and discharge management has been applied to compensate the power fluctuations of the renewable resources and to improve the load reliability.

Under charging conditions, the output power of renewable resources is higher than the load level that excess power is injected into the storage system. Battery energy at time t in charge mode is defined as follows [36, 37].

$${E}_{Batt}\left(t\right)={E}_{Batt}\left(t-1\right)+\left[{P}_{PV}\left(t\right)+{P}_{WG}\left(t\right)-\frac{{P}_{Load}\left(t\right)}{{\eta }_{inv}}\right].{\eta }_{ch}.\Delta t$$
(8)

where, \({E}_{Batt}\left(t\right)\) and \({E}_{Batt}\left(t-1\right)\) refer to the stored energy in time steps t and t-1 and \({\eta }_{inv}\) is inverter efficiency.\({\eta }_{ch}\) is battery charging efficiency.

In discharge conditions, the output power of the renewable resources is lower than the load, which deficit power is compensated by the battery discharge. The battery capacity at time t in discharge mode is defined as follows [36, 37].

$${E}_{Batt}\left(t\right)={E}_{Batt}\left(t-1\right)-\left[{\frac{{P}_{Load}\left(t\right)}{{\eta }_{inv}}-(P}_{PV}\left(t\right)+{P}_{WG}\left(t\right))\right]/{\eta }_{disch}.\Delta t$$
(9)

where, \({\eta }_{disch}\) is battery discharging efficiency.

2.5 Load demand models

The load demand has uncertainty and its uncertainty should be considered in the hybrid system design. The suggested PDF for the load demand is a normal PDF [38], which is defined as follows.

$$f\left( x \right) = \frac{1}{{\sigma \sqrt {2\pi } ~}}e^{{\frac{{ - \left( {x - \mu } \right)}}{{2\sigma ^{2} }}}}$$
(10)

where, x refers to the load, f(x) is the normal load distribution function and μ and σ are the mean and deviation of the load criterion.

3 Problem formulation

The goal of the system design is minimizing the objective function (OF) as the total cost of the hybrid system (TCHS), including the cost of system components as well as the cost of load loss considering satisfying the reliability constraint as deficit power probability probability-hourly interruption probability index (DPPHIP) incorporating generation and load uncertainty. In other words, such a goal requires identifying the best size of the system components, including the number of PVs, WTs, batteries, inverter injected power to the load, PV panel angle, and wind tower height via the ICSA method.

3.1 Objective function

The OF of the hybrid system design is minimizing the TCHS as follows [9, 11], and [30,31,32,33]. The \(TCHS\) includes capital cost (Ccap), maintenance cost (Cmain), replacement cost (Crep) of the system components as well as the cost of load loss (\({C}_{loss-load}\)). In the OF, the cost of load loss is added to the cost of energy generation in the hybrid system design. The energy generation cost is related to PVs, WTs, batteries, and also inverter capacity.

$$Min~TCHS = C_{{cap}} + C_{{main}} + C_{{rep}} + C_{{loss - load}}$$
(11)

The capital cost of system components related to photovoltaics, wind turbines, batteries, and also inverters is defined by

$${{C}_{cap}=C}_{PVc}\times {N}_{PV}+{C}_{WTc}\times {N}_{WT}+{C}_{Batc}\times {N}_{Bat}+{C}_{Invc}\times {N}_{Inv}$$
(12)

The maintenance cost of the system components for photovoltaic, wind turbines, batteries, and also inverters are presented as follow:

$${{C}_{main}=PWA\times (C}_{PVm}\times {N}_{PV}+{C}_{WTm}\times {N}_{WT}{+C}_{Batm}\times {N}_{Bat}+{C}_{Invm}\times {N}_{Inv})$$
(13)

The present annual value and also interest rate is presented by

$$PWA\left(ir,R\right)=\frac{{\left(1+ir\right)}^{R}-1}{ir{\left(1+ir\right)}^{R}}$$
(14)
$$ir=\frac{{ir}_{nominal}-f}{1+f}$$
(15)

The replacement cost of the hybrid system components are related to photovoltaic, wind turbines, batteries, and inverters that are defined as follows:

$${{C}_{rep}=K\times (C}_{PVr}\times {N}_{PV}+{C}_{WTr}\times {N}_{WT}+{+C}_{Batr}\times {N}_{Bat}+{C}_{Invr}\times {N}_{Inv})$$
(16)
$${k}_{i}=\sum _{n=1}^{yi}\frac{1}{{\left(1+ir\right)}^{n.Li}}$$
(17)

Moreover, the cost of load loss is calculated by

$${C}_{loss-load}=\sum _{t=1}^{T}DP\left(t\right).{C}_{loss-kWh}$$
(18)

where, \({C}_{cap}\), \({C}_{main}\), and \({C}_{rep}\) are the investment, maintenance and operating cost and replacement costs of components, respectively and \({C}_{loss-load}\) indicates the cost of load loss. \({N}_{PV}\), \({N}_{WT}\), \({N}_{Bat}\) and \({N}_{Inv}\) are the number of PV panels, WTs, batteries and inverters. \({C}_{PVc}\), \({C}_{WTc}\), \({C}_{Batc}\) and \({C}_{Invc}\) represent components investment costs, \({C}_{PVm}\), \({C}_{WTm}\), \({C}_{Batm}\) and \({C}_{Invm}\) are components maintenance and operating costs, and \({C}_{PVr}\), \({C}_{WTr}\), \({C}_{Batr}\) and \({C}_{Invr}\) components replacement costs. R refers to the project life (20 yrs). Parameter of ir refers to actual interest rate (6%) which is achieved in terms of irnominal as rated interest rate and annual inflation rate (f). Parameters \(PWA\) and K indicate the present annual value and fixed payments, respectively. \(DP\) and \({C}_{loss-kWh}\) are the load unmet power and the penalty cost per kW of \(DP\), respectively. Also, T is the duration of the study period (8760 h).

3.2 Constraints

Probability of deficit power (PDP) as well as hourly interruption probability (HIP) as reliability constraints are formulated as follows [14]:

$$PDP = \frac{{\mathop \sum \nolimits_{{t = 1}}^{T} \left[ {\left[ {\frac{{P_{{Load}} \left( t \right)}}{{~\eta _{{Inv}} }} - P_{{PV}} \left( t \right) - P_{{WT}} \left( t \right)} \right].\Delta t - \left[ {E_{{Batt}} \left( {t - 1} \right) - \left( {\left( {1 - DOD} \right).E_{{Batt - Max}} } \right)} \right].~\eta _{{Bat}} } \right]}}{{\mathop \sum \nolimits_{{t = 1}}^{T} \left[ {P_{{Load}} \left( t \right)} \right]}}$$
(19)
$$\mathrm{H}\mathrm{I}\mathrm{P}=\frac{\sum _{t=1}^{T}[Time\left({P}_{available}\left(t\right)<{P}_{Load}\left(t\right)\right)]}{T}$$
(20)

\(DP\left(t\right)\) is the deficit of load demand at time t, \({P}_{Load}\left(t\right)\) is load demand at time t, \({P}_{available}\left(t\right)\) is transferred power to the load by renewable resources and storage. T is the project study time (8760 h). The \(DOD\) refers to the depth of battery discharge (0.8) [14]. Therefore, the reliability constraint is defined as follows:

$$PDP~ \le ~PDP~^{{max}}$$
(21)
$$HIP \le HIP\;^{{max}}$$
(22)

where, PDPmax and HIPmax are max value of \(PDP\) and \(HIP\), respectively.

Also, the capacity constraints of hybrid system components are defined as follows.

$${N}_{PV}^{min}\le {N}_{PV}\le {N}_{PV}^{max}$$
(23)
$${N}_{WT}^{min}\le {N}_{WT}\le {N}_{WT}^{max}$$
(24)
$${N}_{Batt}^{min}\le {N}_{Batt}\le {N}_{Batt}^{max}$$
(25)
$${P}_{inv}^{min}\le {P}_{Inv}\le {P}_{inv}^{max}$$
(26)
$${\theta }_{PV}^{min}\le {\theta }_{PV}\le {\theta }_{PV}^{max}$$
(27)
$${H}_{WT}^{min}\le {H}_{WT}\le {H}_{WT}^{max}$$
(28)

The minimum and maximum number of PV units (\({N}_{PV}\)), wind units (\({N}_{WT}\)) and batteries (\({N}_{Batt}\)), inverter capacity (\({P}_{Inv}\)), PV panel angle (\({\theta }_{PV}\)) and wind tower height (\({H}_{WT}\)) are included as problem constraints.

4 Proposed method

In this study, the modified crow search algorithm (ICSA) is used to determine the optimal size of PV/WT/Batt system components considering the uncertainty which is described below.

4.1 Overview of Improved Crow Search Algorithm (ICSA)

The crow search algorithm is implemented based on the hiding behavior of crows' food. Crows hide their surplus food in special places and find it when they need it. Pursuit of a crow to access the hidden food of another crow may be such that the crow is not aware of its pursuit by another crow, in which case its hiding place will be revealed, or the crow may be aware of the pursuit of another crow. Random position and movement are done to hide the food hiding place [25, 26].

The position of crow i in iteration, considering the number of crow N, are as follows [25, 26]:

$$X^{{i,iter}} = ~\left( {i = 1,2, \ldots ,N;~iter = ~1,2, \ldots ,iter_{{\max }} } \right)$$
(29)

where, \({iter}_{max}\) refers to the iteration's maximum number.

The CSA algorithm, after starting with a random solution set, updates the search memory to determine the optimal solution in the search space and creates a new position based on awareness probability (AP) and flight length (FL).

The CSA algorithm is presented in the following two phases:

Phase 1 Crow j does not recognize that he is being chased by crow i. In this phase, crow i approach the hidden place of crow j food as follows [25, 26]:

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

where, \({r}_{i}\) refers to a random number ([0, 1]) and FLi, iter represents the crow i flight length in iter iteration.

Phase 2 Crow j knows that he is being chased by crow i. So crow j changes its position in the search space based on the following relation to preventing the food hiding place from being revealed:

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

where, \({x}^{i,iter}\) refers to the crow i present position in iter iteration and \({AP}^{j,iter}\) indicates the probability that crow j is aware of iteration.

4.2 Implementation of ICSA for optimal system design

In this study, the genetic operators as crossover and mutation [39] are applied for enhancing the CSA capability and the resulting algorithm is named improved CSA (ICSA). The flowchart of a battery storage operation and hybrid PV/WT/Batt design is showed in Fig. 2. The ICSA implementation steps for solving the designing of the hybrid system considering uncertainty are as follows:

Fig. 2
figure 2

a Battery storage operation and b flowchart of hybrid PV/WT/Batt design

Step 1 Apply the design data and algorithm parameters. In this step, data of components cost and capacity and also the algorithm parameters including crow population number, the maximum number of iteration, FL and AP.

Step 2 Stochastic parameters of the hybrid system, including load, wind speed, and consequently, the capacity of WTs and PVs are found randomly and according to the probability distribution functions of each of them. The number of random samples (generated by the MCS) must be the same for all parameters.

Step 3 For i = 1:Nsamp (Nsamp: is the number of random samples in the simulation), a random sample of each random parameter is selected. In order to create different scenarios for the existing uncertainty, which includes PV and wind power as well as load demand, the Monte Carlo sampling method [16, 22 and 24] has been used. Based on this, 1000 random samples of 8760 h information are generated for each of the uncertain parameters presented by the MCS. Also, low probability samples are discarded and finally, 100 samples (matrix 1 in 8760) are applied to the program for each uncertain parameter.

Step 4 The population of the optimization algorithm is determined in the form of decision variables. The decision vector is defined based on the number of PV panels, the number of WTs and the number of batteries, transfer the power of the inverter to the load, the angle of the PV panels, and the height of the wind tower as follows:

$$X = \left[ {N_{{PV~~}} ~N_{{WG~~}} N_{{Batt~}} P_{{inv~}} ~\theta _{{PV}} ~h_{{wg~}} } \right]$$
(32)

Step 5) The TCHS is computed for each CSA population member by satisfying the constraints of the problem. The constraints of the problem are the constraints of the PVs, WTs, batteries, the angle of the panels with sunlight, and as well as the height of the wind tower.

Step 6 In this step, the crow with the lowest TCHS is determined as the best.

Step 7 The algorithm population is updated and the TCHS value is calculated for each updated population. In the case of achieving a better objective function than in step 6, the best OF is considered the best solution.

$$m^{{i,iter + 1}} = \left\{ {\begin{array}{*{20}c} {x^{{i,iter + 1}} ~~~~~~~~~~f\left( {~x^{{i,iter + 1}} } \right)~is~better~than~~f\left( {~m^{{i,iter~}} } \right)~~} \\ {m^{{i,iter~}} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~otherwise~~~~~~~~~~~~~~~~~~~~~~~~~~} \\ \end{array} } \right.$$
(33)

Step 8 At this step, the mutation and crossover operators of the genetic algorithm are used for the population of the CSA algorithm with the aim of preventing trapping in the local optimal and power increasing the algorithm in achieving the global optimal.

Step 9 In this step, the TCHS is calculated for the updated population in step 8. If the TCHS value is less than the value obtained in step 7, it is replaced with it.

Step 10 Repeat steps 3 to 9 to achieve the convergence criteria (achieving the lowest TCHS and implementation of maximum iterations). If the convergence criteria are met, go to step 11, otherwise, go to step 7.

Step 11 The probability distribution function (PDF) of the optimal variables and as a result, the TCHS objective function and the reliability constraints are plotted and the results are obtained numerically.

5 Simulation results

The results of hybrid PV/WT/Batt system designing are given as deterministic (without uncertainty) and as probabilistic (with uncertainty) for Zanjan city in Iran country. The parameters of the hybrid system components are presented in Table 1. The coding of the problem is done in the MATLAB area.

Table 1 Parameters of hybrid PV/WT/Batt system components [14, 36]

5.1 Results of deterministic design of hybrid system (without uncertainty)

Figure 3, shows the environmental information includes real data of irradiance and wind speed during a year (2018) for the Zanjan region [40, 41] with load data related to residential demand. The total load demand is 153.87 MWh during a year.

Fig. 3
figure 3

Changes curve a irradiance, b wind speed and c load demand of the complex during one year for the city of Zanjan

In the study [14], PV/WT/Batt system designing is done as deterministic with the objective of cost of components using ICSA. The uncertainty and also cost of load loss are not considered in the system design in [14]. In this section, the impact of considering the cost of load loss (\({C}_{loss-load}\)) is investigated in deterministic problem and the results are evaluated with the method in [14]. In this paper, the hybrid PV/WT/Batt system is designed considering \({C}_{loss-load}\) using ICSA, CSA and PSO algorithms, and the results are compared with [14]. The best results for each method are extracted after 20 runs and 50 populations and a maximum of 100 replications. The min and max values of the optimization variables are also given in Table 2.

Table 2 Range of changes in optimization variables for PV/WT/Batt system design

The PV/WT/Batt system designing is simulated to minimize the TCHS as well as load loss cost considering DPHIPmax = 5% and the obtained results are given. The capability of the ICSA is evaluated in comparison with the CSA and PSO methods. The results of the deterministic design of different system combinations are given in Table 3 and the obtained results are compared with the Ref. [14]. The results cleared that the PV/Batt without the participation of wind energy is the best combination in terms of cost and reliability for Zanjan city and this result is adapted to Ref. [14]. The convergence process of the PV/Batt system design is also shown in Fig. 4, using different algorithms. The Fig. 4, shows that the ICSA method has a lower cost than the CSA and PSO and also has converged in a lower number of iterations and found the optimal solution.

Table 3 The sizing results of different hybrid system combinations for DPHIPmax = 5% with and without \({C}_{loss-load}\)
Fig. 4
figure 4

Convergence curve of different algorithms in PV/Batt system designing with DPHIPmax = 5% considering CLoss

Based on the obtained results in Table 3, the PV/Batt system is the optimal selection for the Zanjan city in deterministic design. The results cleared that the PV/Batt system with a cost of $ 1.1979 M$, HIP and DPP are equal to 187 h and 0.0192 MW is the optimal combination in view of economic and technical aspects. The results also cleared that the TCHS of the WT/Batt system design for load supply is higher and the reliability is lower than the optimal combination. Comparing the results with Ref. [14], it is observed that considering Closs-load has increased the cost but significantly improved the reliability of the load. The HIP value compared to Ref. [14], is decreased from 438 to 187 h, the amount of DPP is decreased from 0.0328 MW to 0.0192 MW and the cost increased by 18.63%. In the other hybrid system combination considering Closs-load, the system cost has increased and the reliability indices have improved. Therefore, considering Closs-load, as part of the objective function provides a more reliable and popular system in the energy market to provide remote applications, especially sensitive loads that require high reliability.

In Fig. 5, the changes in battery storage energy with DPPHIPmax = 5% for the hybrid PV/Batt system are plotted based on the ICSA with and without Closs-load. According to the obtained results and the improvement of reliability considering Closs-load, the level of the storage system has increased.

Fig. 5
figure 5

Storage energy changes of hybrid PV/Batt system for DPHIPmax = 5% with and without \({C}_{loss-load}\)

5.2 Results of probabilistic design of hybrid system (with uncertainty)

The probabilistic results of hybrid PV/WT/Batt system designing are given using the ICSA algorithm considering generation and load uncertainty based on probability distribution functions (PDFs) of real data for Zanjan city. It must be said that the optimal combination of the hybrid system in the design without uncertainty for the city of Zanjan, is obtained hybrid PV/Batt system, although the results are almost similar to the PV/WT/Batt combination but without the contribution of WTs. For this reason and for considering the uncertainty of both PV and wind sources, the probabilistic approach is implemented on the hybrid PV/WT/Batt system. Figures 6, 7, 8 showed the irradiance, wind speed, and load PDFs.

Fig. 6
figure 6

Irradiance probability distribution function

Fig. 7
figure 7

Wind speed probability distribution function

Fig. 8
figure 8

Hybrid system load probability distribution function

After initiating the PDFs of irradiance, wind speed, and load demand and implementing the proposed method based on the ICSA, the PDFs of decision variables are shown in Fig. 9. It should be noted that the number or value of each decision variable is obtained from the sum of multiply each sample by its probability (density axis). The numerical results of the probabilistic design and its comparison with the deterministic design are also presented in Table 4.

Fig. 9
figure 9

PDF of decision variables a Number of PVs b Number of WTs c Number of batteries d Tranfered power to load by inverter e Wind tower height and f PV angle

Table 4 Designing results of hybrid PV/WT/Batt system for DPHIPmax = 5% with \({C}_{loss-load}\)

The probabilistic design results of the hybrid PV/WT/Batt system are presented for DPPHIPmax = 5% with Closs-load in Table 4. Based on the deterministic design results, the optimization program has used the contribution of PV resources and batteries (PV/Batt system) to meet the load. While considering the uncertainty, the program has used the contribution of both PV and wind sources to supply the load. In the deterministic case, one-year of information of irradiance and wind speed is used to design the hybrid system, which can not be enough information to measure the potential of energy resources in Zanjan, while in the probabilistic design approach, different scenarios of radiation and wind speed are considered as PDFs. According to the probabilistic design results, 125 WTs, 204 PVs, and 819 batteries are used to supply the load. Based on the load changes in the uncertainty designing, the transferred power of the inverter to the load is obtained 35.56 kW, the height of the wind tower is 31.2 and the angle of the PV panels is 47.62 degrees. The TCHS has increased from $ 1.1979 to $ 1.210 M$ in the probabilistic approach compared to the deterministic designing. Also, the DPP has been reduced from 0.0192 to 0.0167 MW and the HIP is reduced from 187 to 72 h due to considering uncertainty in the probabilistic approach. Therefore, considering generation and load uncertainty, the cost of hybrid system design is increased but the system reliability is improved.

The PDFs of TCHS, DPP, and HIP are depicted in Figs. 10, 11, 12, respectively. According to these figures, the value of changes in each index and the probability of its occurrence are given.

Fig. 10
figure 10

PDF of TCHS

Fig. 11
figure 11

PDF of DPP

Fig. 12
figure 12

PDF of HI

6 Discussion

In [14], the deterministic the hybrid PV/WT/Batt system designing is studied to meet the load demand considering real data of Zanjan region, Iran country. The objective of this study is to identify the best size of hybrid system components with minimizing the TCHS and DPPHIP enhancement using ICSA meta-heuristic algorithm. It should be noted that the deterministic design of hybrid PV/WT/Batt system is studied without considering the uncertainty of generation and load in [14]. Comparison of the results between the deterministic design in Ref. [14] and the probabilistic designing of PV/WT/Batt for DPHIPmax = 5% are presented in Table 5. It is clear that the ICSA method in [14] obtained the optimal combination as PV/Batt system with 333 PVs, 389 batteries, and an inverter transfer power equal to 29.52 kW. Also, according to the results of Table 5, considering the uncertainty, the ICSA has obtained 125 WTs, 204 PVs, 819 batteries, and an inverter transfer power equal to 35.58 kW. On the other hand, it can be seen that the amount of TCHS in the deterministic and probabilistic design is equal to 1.0108 and 1.210 M$, respectively, which indicates that the cost has increased due to considering uncertainty. The load of the system and also renewable resources generation have uncertainty that must be considered in actual designing of the hybrid system, determination of the accurate contribution of the renewable energy resources and storage units, designing cost and reliability of the hybrid system. In addition, considering the uncertainty in the hybrid system designing allows energy system engineers to make the right decisions based on possible probabilities and investment budgets. Also, considering the uncertainty prevents large costs due to incorrect sizing of system components due to deterministic designing and thus the system load is supplied with more reliability considering uncertainty.

Table 5 Comparison results of deterministic and probabilistic design of hybrid PV/WT/Batt system

7 Conclusion

In this paper designing framework for a hybrid PV/WT/Batt system is presented with the objective of minimizing the TCHS and satisfying the DPPHIP as reliability constraint considering the uncertainty of PV and wind generation and load demand for the Zanjan city in Iran country. The optimal size of the components, including the number of PVs, WTs, and batteries, as well as inverter power capacity, the height of the wind tower, and the angle of the PV panels are determined optimally using the ICSA. The simulation results are presented for different approaches such as deterministic and probabilistic methods with and without the uncertainty, respectively. The results of the deterministic design are given for various combinations of the hybrid system and the optimal configuration of the system is found with the lowest cost and more reliability value. Also, the probabilistic design of the system considering the uncertainty of generation and load demand is performed using Monte Carlo simulation based on the probability distribution functions of irradiance, wind speed, and load power. The performance of the ICSA is evaluated in comparison with the CSA and PSO in a deterministic approach and the achieved results of deterministic and probabilistic approaches are compared.

The results of deterministic design showed that the renewable resources with energy management of the battery storage are capable to supply the load in all system configurations. The obtained results demonstrated that the hybrid PV/Batt system is determined as the optimal configuration of the hybrid system with minimum TCHS and higher reliability than the other configurations. Also, the results cleared that considering the cost of load loss in objective function provides a more reliable system for supplying the sensitive loads, which further improves the reliability index. In deterministic design, the superiority of the ICSA is proved with lower cost and better reliability than the CSA and PSO. Moreover, the results of the probabilistic approach showed that the TCHS of the hybrid system is increased more but the reliability is more enhanced significantly compared to the deterministic approach. So, the results of the probabilistic design showed that the uncertainties of the generation and load demand should be considered to achieve a cost-effective and reliable system in the hybrid system designing.