1 Introduction

Load shedding is a strategy to manage power distribution in a country when generation capacity cannot adequately meet the load demand of electricity consumers. Currently, South Africa is undergoing load shedding, and this is affecting manufacturing and service delivery. This study is motivated by the fact that “shortage of generation capacity and the need to carry out unplanned maintenance to return units to service, unfortunately, will lead to implementing load shedding as a last resort” (“Stage 4 load shedding will continue to be implemented throughout Thursday and Friday, with a possibility of lower stages from Saturday morning 2022). One of the solutions to interruption in power generation is harnessing renewable energy. Currently, coal is by far the major energy source for South Africa, comprising around 80 percent of the country’s energy mix. However, the production of energy in South Africa is unreliable and deteriorating, thus calling for greater use of renewable energy to substitute conventional power plants (“Power Africa in South Africa | Power Africa | US Agency for International Development” 2022).

In recent times, renewable energy technology adoption is fast spreading to fulfill the ever-increasing energy demand of society, but these resources are unreliable due to the stochastic nature of their occurrence. Renewable energy is the energy obtained from the natural environment, particularly from wind, sun, and other sources, which are in abundance, and yet some countries lack the needed technology to stimulate energy production. For instance, the African continent has a larger amount of renewable natural resources (Aliyu et al. 2018) and yet, the continent is challenged in terms of sustainable energy infrastructures, and it needs technology to drive energy from renewable sources. Africa is ranked lower in terms of sustainable development because its countries are unable to meet the energy needs of their consumers and industries (Ibrahim et al. 2019). Unfortunately, some African countries largely depend on fossil fuels which cannot meet the daily energy needs of industries (Ibrahim et al. 2019; Yüksel 2010). Unfortunately, fossil fuel is more expensive or may not be available at all locations in a country, thus driving an increase in the cost of fossil fuel production. Renewable energy technologies are more environmentally friendly which makes them the ideal form of energy production. Thus, intelligent management of renewable energy systems will have both economic and environmental advantages (Aljohani et al. 2020; Nguyen et al. 2020).

The challenge, however, in using renewable energy systems is that renewable resources like solar and wind are uncertainties and hence unpredictable because climatic weather depends on or is influenced by seasonal variations (Ayodele and Ogunjuyigbe 2016). This phenomenon ensures that individual renewable energy sources lack the potential to supply reliable power all year round. By combining two or more renewable energy technologies for electricity generation, the system’s security is improved. Accordingly, optimizing hybrid renewable energy systems (HRES) has become a topical subject among the scientific and engineering communities (Ghofrani and Hosseini 2016; Khezri and Mahmoudi 2020; Hassas et al. 2017; Kalananda and Komanapalli 2021).

Hybridizing multiple resources including renewable and/or non-renewable to match load requirements need thorough analysis, in ensuring the correct dimensioning and energy resource mix. The research gap is that when a hybrid system is undersized, it becomes unreliable and does not meet load demand, whereas oversizing would be economically unattractive. Thus, optimization of HRES aims at economic management as well as the satisfaction of end-users needs (Suresh et al. 2020). To this end, the goal of this study is to determine the economic and reliable renewable energy mix based on a nature-inspired optimization algorithm. The contribution of this study is to propose a solution that determine the feasible renewable energy mix and its costs using a nature-inspired optimization method. The innovation in this study relating to the nature-inspired algorithm is the consideration of random vibration of prey that spreads across the social spider's web at a frequency which signifies prey has been captured. Furthermore, this vibration of prey is significant in the formulation of mathematical model to help determine a reliable and economic renewable energy mix. Hence, the reason to adopt the SSP which is inspired by nature. The advantage of using nature-inspired algorithm is the ability to avoid non-promising search space using their random behavior.

Sections of this paper are structured as follows: Sect. 2 (related works), Sect. 3 (Methodology), Sect. 4 (Experiment settings and data), Sect. 5 (Results and analysis), Sect. 6 (Computational complexity), Sect. 7 (Statistical analysis), Sect. 8 (Discussion of results), and Sect. 9 (Conclusion).

2 Related work

2.1 Nature-inspired optimization

A hybrid renewable energy system helps in finding the best possible mix of renewable energy sources for power generation. Several nature-inspired optimization approaches have been applied to find the most feasible approach to optimize energy generation. The advantages of nature-inspired methods topple other classical optimization approaches. Nature-inspired optimization algorithm is developed from the behaviors of natural living organisms. In some instances, these nature-inspired algorithms are referred to as artificial intelligence (AI) techniques (Twaha and Ramli 2018) and examples include particle swarm optimization (PSO) (Tezer et al. 2016), genetic algorithm (GA) (Xiao et al. 2018; Mandal 2020; Mohamed et al. 2017), ant colony optimization (ACO) (Sinha and Chandel 2015), biogeography-based optimizations (BBO) (Kalananda and Komanapalli 2021), artificial bee colony (ABC) (Al-falahi et al. 2017), artificial immune system (AIS), distributed gray wolf optimizer (DGWO), cuckoo search (CS), advanced dwarf mongoose optimization (ADMO), differential equation (DE), gazelle optimization algorithm (GOA), and genetic algorithm (HGWOGA) harmony search (HS), and combinations of them. AI techniques have demonstrated effective and robust solutions even under complex problems (Al-falahi et al. 2017). Table 1 presents the benefits and shortfalls of commonly used AI techniques in HRES optimization.

Table 1 Advantages and disadvantages of nature-inspired algorithms for mini-grid HRES optimization

AI techniques in solving the HRES optimization problem are far-reaching in the literature. For example, the authors of Singh et al. (2016) used a swarm-based artificial bee colony (ABC) algorithm to determine the optimal size of a hybrid PV–wind generation system along with biomass and storage to fulfill the electrical load demand of a small area. They compared the results obtained with results derived from a standard software tool, a hybrid optimization model for electric renewable (HOMER), and PSO algorithms. Their ABC algorithm showed good convergence and the ability to provide quality results. The PSO and Monte Carlo simulation has been used by Maleki et al. (2016) to study a real-case scenario for an off-grid hybrid multi-source system comprising PV–wind–battery. The optimal solution accounted for the size of the components, the total annual cost as well as the uncertainties in wind speed and solar radiation while meeting the electrical demand.

2.2 Hybrid renewable energy systems

A hybrid renewable energy system combines two or more renewable energy sources or at least one renewable power source with non-renewable energy. Though an energy system can operate independently, it is unreliable. On the other hand, HRES are more reliable and less costly than an independent source of power generation. HRES address three major concerns relating to the reliability of power supply, economic factors, and environmental concerns, mostly described as the trilemma of energy (Approach et al. 2020). Consequently, the various components and optimization approaches in designing a hybrid renewable energy system to ensure efficient production of energy to meet load demand are shown in Fig. 1.

Fig. 1
figure 1

Various aspects of HRES optimization

Figure 2 shows the schematic diagram of the hybrid PV–wind–biomass system. The various components that would help in generating electricity from renewable resources include solar PV panels, wind turbines, biomass generators, and inverters/converters that would be connected to the load.

Fig. 2
figure 2

Schematic diagram of hybrid PV–wind–biomass system

The individual renewable energy sources cannot provide continuous power supply to the load because of the uncertainty and on-and-off nature of the environmental conditions. Again, solar and wind sources of energy are intermittent thus requiring biomass (biogas generator) or energy storage systems to avert these uncertainties (Singh et al. 2016).

  • Solar PhotoVoltaic (PV): captures the irradiation of the sun and converts the solar energy into direct current (DC). Solar PV/cell is made up of semi-conducting material which can emit electrons (charged particles) upon receiving reasonable radiation from the sun. In designing a solar PV-based hybrid system, the number of solar cells or total solar panel surface area is estimated to determine the amount of power generation. Figure 3 shows the design of solar PV.

  • Wind turbines: convert wind energy into electric energy. The energy generated by a wind turbine depends on the wind velocity acting on the turbine at that moment. The inbuilt mechanism of the wind turbine helps to convert kinetic energy from the wind into electric power via an electric generator in the turbine.

  • Biomass (biogas gasifier): Biomass resources are in different forms and converting biomass into gas makes it versatile to meet the broader scope of energy needs including electricity provision. The forms of biomass include animal and human wastes, sewage sludge, crop residues, industrial processing by-products, landfill materials, and many more. The electrical energy is estimated by calculating the calorific factor per volume (m3) of biogas produced, which informs the configuration size or capacity of the biogas generator.

  • Batteries/energy storage system: these devices store power for future use. However, the sizing of batteries depends on the load and size of the renewable power generation units.

Fig.3
figure 3

Design of solar PV

Inverters toggle electrical current from alternating and direct current to another depending on the system’s configuration or energy need of the load demand.

Modeling, evaluating, and dimensioning solar modules, wind turbines, battery storage, and biomass gasifiers are important decision variables to harmonize the operation of the proposed hybrid system. The subsequent subsections describe the mathematical models underpinning the schematic diagram in Fig. 2.

2.2.1 Modeling of PV system

Modeling a solar PV system ensures maximum power generation. Fortunately, PV panels have a manufacturer’s data sheet to help in setting up any PV system. The output power generated from a PV array depends on a specified temperature at a given time and solar irradiance measured at standard temperature conditions (STC). Using the solar radiation available on the tilted surface of the solar panel, the ambient temperature \(T_{c}\) and the manufacturer output of the PV generator, the PV power \(Pv_{\left( t \right)}\) generated at a given time t is deduced thus (Abdelaziz Mohamed and Eltamaly 2017):

$$ Pv_{\left( t \right)} = \eta {\text{NAG}}_{\left( t \right)} $$
(1)

where \(\eta { }\) denotes the PV generation efficiency, \(A{ }\left( {{\text{m}}^{2} } \right)\) is the area of a single PV module used in the setup, N is the number of PV modules constituting the PV array, and \(G_{\left( t \right)} { }\left( {{\text{W}}/{\text{m}}^{2} } \right)\) is the incident solar irradiation on the tilted module plane. Certain assumptions are made for energy losses within the system, such as the connection and wiring losses are assumed to be zero. The efficiency \(\eta\) of the PV generator considering all losses is further related to the ambient temperature \(T_{c}\) as:

$$ n = { }\eta_{r} { }\left[ {1 - { }\beta \left( {T_{c} - { }T_{{{\text{cref}}}} } \right)} \right] $$
(2)

where \(\eta_{{\text{r}}}\) denotes the reference module efficiency, \(T_{{{\text{cref}}}}\) is the reference cell temperature in °C \(\beta\) is the temperature coefficient of PV panel. The efficiency of the power tracking device is equal to 1 if a perfect MPPT is used and \(T_{c}\) is the temperature (°C) of the PV cell.

\(T_{c}\) can be calculated by the following equation:

$$ T_{c} = { }T_{{{\text{air}}}} + \left( {\frac{{{\text{NOCT}} - 20}}{800}} \right)R_{t} $$
(3)

Such that \( T_{{{\text{air}}}}\) is the air temperature given by the temperature profile, \({\text{NOCT}}\) is the operating temperature of the solar cell in °C and \(R_{t}\) is the solar radiation in an instant of time (t) given in \(\left( {{\text{W}}/{\text{m}}^{2} } \right)\). The value of \(NOCT\) is 28 °C, and \(T_{cref} =\) 25 °C.

2.2.2 Modeling of wind turbine system

The output of a wind turbine generator depends on two main parameters, namely wind speed at the hub height and the wind speed characteristics of the turbine. The wind speed at hub height is expressed using the power-law equation (Abdelaziz Mohamed and Eltamaly 2017; Kalappan and Ponnudsamy 2013):

$$ \frac{{V_{{\text{z}}} }}{{V_{{\text{h}}} }} = \left[ {\frac{Z}{{Z_{h} }}} \right]^{x} $$
(4)

where Vz and Vh are wind speeds at hub height and reference height Z and Zh, respectively, and \(x\) is the power-law exponent which is a function of both the atmospheric stability in the zone where \(x\) is evaluated to be valid for the surface area characteristics. On a vast land, for example, \(x\) is estimated to be 1/7.

Once wind speed has been properly modeled and sufficient but accurate wind data are obtainable, the power generated by the wind turbine at a given time \(Pw_{\left( t \right)}\) can be estimated as shown in Fig. 4. Energy is generated between the cut-in wind speed, shown as \(V_{ci}\), and the cutout wind speed, shown as \(V_{co} \). Between the rated wind speed \(V_{r}\) and \(V_{co}\), the power generated remain constant.

Fig. 4
figure 4

Wind speed–power characteristics

The output power \({Pw}_{\left(t\right)}\) of wind turbine generator is calculated as:

$$ Pw_{\left( t \right)} = \frac{1}{2}C_{p} \rho AV_{\left( t \right)}^{3} $$
(5)

where \(C_{{\text{p}}}\) denotes the power coefficient for the wind turbine characteristic, \(\rho\) is the air density (kg/m3), \(A\) is the swept area of the wind turbine rotor (m2), and V is the velocity of the wind.

The wind turbine is characterized by the speed–power curve which is generally represented as a spline curve. The curve depicts cut-in speed (\(V_{{{\text{ci}}}}\)), cutout speed (\(V_{{{\text{co}}}}\)), and rated/nominal wind speed (\(V_{{\text{r}}}\)) of the wind turbine. The \(V_{{{\text{ci}}}}\) is the minimum wind speed threshold with which the wind turbine starts to rotate and generate power; the \(V_{{{\text{co}}}}\) is the maximum wind speed threshold beyond which the wind turbine rotates very fast and stands the risk of damaging the rotor, so a breaking mechanism is enforced to halt the system when \(V_{{{\text{co}}}}\) is exceeded. The \(V_{{\text{r}}}\) is the wind speed between \(V_{{{\text{ci}}}}\) and \(V_{{{\text{co}}}}\) where the power output reaches the maximum. Most wind turbines do not have a uniform gradient line between cut-in wind speed and the rated wind speed. Hence, the power characteristic curve as a function of the wind speed is given by:

$$ Pw_{\left( t \right)} = \left\{ {\begin{array}{*{20}l} {0,} & {{\text{if}}\; v\left( t \right) < V_{{{\text{ci}}}} } \\ {\frac{{P_{{\text{r}}} }}{{(V_{r}^{3} - V_{{{\text{ci}}}}^{3} )}} v_{\left( t \right)} - \frac{{V_{{{\text{ci}}}}^{3} }}{{(V_{{\text{r}}}^{3} - V_{{{\text{ci}}}}^{3} )}}P_{r} ,} & {{\text{if}}\; V_{ci} \le v\left( t \right) < V_{{\text{r}}} } \\ {P_{r} ,} & {{\text{if}}\;V_{r} \le v\left( t \right) < V_{{{\text{co}}}} } \\ {0,} & {{\text{if}}\; v\left( t \right) > V_{{{\text{co}}}} } \\ \end{array} } \right. $$
(6)

where \(P_{{\text{r}}}\) is the rated electrical power generated by the system and the wind turbine performance calculations need to consider the effects of wind turbine installation height. Actual power \(P_{W}\) available from a wind turbine can be expressed as follows:

$$ P_{W} = Pw_{\left( t \right)} A_{{{\text{wind}}}} \eta { } $$
(7)

\(A_{{{\text{wind}}}}\) is the total swept area, and \(\eta\) is the efficiency of wind turbine generators and converters.

2.2.3 Modeling of biomass engine

Solid waste biogas for a year depends on the total amount of volatile solid TVS substrate generated, which is expressed by (8) (Singh et al. 2016):

$$ {\text{TVS}}_{{{\text{substrate}}}} \left( {\frac{{{\text{ton}}}}{{{\text{year}}}}} \right) = {\text{SG}}\left( {\frac{{{\text{ton}}}}{{{\text{year}}}}} \right) \times {\text{TS}}\% \times {\text{VS}}\% $$
(8)

where \(SG\) is the solids generated within the year; this quantity could be determined from the feedstock to be used, \(TS\) is the total solids which is the percentage of solids in the biomass, and \(VS\) is volatile solid which is the percentage of the combustible solids in \(TS\). The total \(VS\) is a function of the biogas yield (m3 biogas/kg \(VS\)) for each substrate. Therefore, for solid waste annual biogas production is given by Mugodo et al. (2017):

$$ {\text{Biogas}}\left( {\frac{{{\text{m}}^{3} }}{{{\text{year}}}}} \right) = {\text{TVS}}_{{{\text{substrate}}}} \left( {\frac{{{\text{ton}}}}{{{\text{year}}}}} \right) \times {\text{Biogas yield}} \left( {\frac{{{\text{m}}^{3} }}{{{\text{ton}}}}} \right) $$
(9)

In liquid waste, chemical oxygen demand (COD) is the key estimation factor of biogas generation, and it measures the chemical digestible materials in the wastewater. Out of the total COD found in liquid waste, about 70–90% of their values are utilized to generate biogas from anaerobic digestion, particularly for agriculture and agro-processing wastes with various technologies. The treated COD for biogas generation using wastewater is given by Mugodo et al. (2017):

$$ {\text{COD}}_{{{\text{treated}}}} \left( {\frac{{{\text{kg}}}}{year}} \right) = {\text{TWWD}}\left( {\frac{{\text{L}}}{{{\text{year}}}}} \right) \times {\text{COD}}_{{{\text{conc}}}} \left( {\frac{{{\text{kg}}}}{{\text{L}}}} \right) \times 80\% $$
(10)

where TWWD is the total wastewater discharged for the year and \({\mathrm{COD}}_{\mathrm{conc}}\) is the COD concentration for the feedstock. The total amount of biogas generated from the liquid waste per year is the product total amount of COD generated and the COD biogas yield as (Mugodo et al. 2017):

$$ {\text{Annual}}\;{\text{biogas}}\left( {\frac{{{\text{m}}^{3} }}{{{\text{year}}}}} \right) = {\text{COD}}_{{{\text{treated}}}} \left( {\frac{{{\text{kg}}}}{{{\text{year}}}}} \right) \times {\text{Biogas}}\;{\text{yield}}\left( {\frac{{{\text{m}}^{3} }}{{{\text{kg}}}}} \right) $$
(11)

The electrical energy derived from biomass could be estimated as:

$$ {\text{Biomass}}_{{{\text{Energy}}}} = {\text{Annual}}\;{\text{biogas}} \left( {\frac{{{\text{m}}^{3} }}{{{\text{year}}}}} \right) \times \frac{6}{{1 \times 10^{6} }}\left( {\frac{{{\text{GWh}}}}{{{\text{m}}^{3} }}} \right) $$
(12)

The calorific factor is 6 kWh per \({\mathrm{m}}^{3}\) of biogas production. Finally, the efficiency of electrical energy production from biomass varies between 30 and 36. Therefore, the electrical energy production from biomass is given by:

$$ {\text{Total}}\;{\text{biomass}}\;{\text{energy}}\left( {\frac{{{\text{GWh}}}}{{{\text{year}}}}} \right) = {\text{Biomass}}_{{{\text{Energy}}}} \left( {\frac{{{\text{GWh}}}}{{{\text{year}}}}} \right) \times 30\% $$
(13)

where GWh is Giga Watt hour per year.

2.2.4 Battery storage system

The power delivered by the battery storage system is measured by the state of charge (SOC) which is a function of the time when a battery is delivering its stored energy. When the battery is charged, the SOC is expressed (Askarzadeh 2017) as follows:

$$ {\text{SOC}}\left( t \right) = {\text{SOC}}\left( {t - 1} \right) + \frac{{\left( {P_{{{\text{batt}}}} \times \Delta \left( t \right)} \right)}}{{1000 \times C_{{{\text{batt}}}} }} $$
(14)

When the battery is in discharge mode, the SOC is also indicated by:

$$ {\text{SOC}}\left( t \right) = {\text{SOC}}\left( {t - 1} \right) - \frac{{\left( {P_{{{\text{batt}}}} \times \Delta \left( t \right)} \right)}}{{1000 \times C_{{{\text{batt}}}} }} $$
(15)

SOC (t − 1) denotes the previous state of charge of the battery before the current time t, SOC (t) is the current state of charge, \({P}_{\mathrm{batt}}\) represents the battery power, \(\Delta (t)\) denotes the time steps to charge or discharge the battery, and \({C}_{\mathrm{batt}}\) represents the nominal capacity of the battery The maximum charging or discharging capacity of the battery storage system can be calculated as follows:

$$ P_{{{\text{batt\_max}}}} = \frac{{N_{{{\text{batt}}}} \times V_{{{\text{batt}}}} \times I_{\max } }}{1000} $$
(16)

where \(N_{{{\text{batt}}}} , V_{{\text{batt, }}} \;{\text{ and}} \;I_{\max }\) denote the number of batteries, the voltage of each battery, and the maximum charging current.

2.2.5 Power converter model

Power converters regulate the power supply to a load when its AC and DC components are present in the system (Nagalakshmi et al. 2014). Notably, solar PV panels and batteries produce DC output power (Singh et al. 2016), and the series of gears in wind turbines increases the rotational speed of the blade in varying proportions from about 18 rpm to around 1800 rpm with wind speed (Fran et al. 2017). The wind turbine generators produce an alternating electrical current. The size of the converter or inverter depends on the peak load requirement (\(P_{{{\text{load}}}}\)) and the efficiency of the device (\(\eta_{{{\text{inv}}}}\)), which is expressed by Eq. 17.

$$ P_{{{\text{inv}}_{R} }} \left( t \right) = P_{{{\text{load}}}} \left( t \right)/\eta_{{{\text{inv}}}} $$
(17)

where \(P_{{inv_{R} }} \left( t \right)\) denotes the rating of the inverter at a given time t.

2.3 The objective function of the hybrid renewable energy system

HRES’s objective is to generate cost-effective and reliable electrical energy. Having an objective function that minimizes the costs and produces reliable energy is crucial for the provision of reliable energy supply. The primary goal of this study is to reduce the overall NPC, ASC, and COE of the proposed hybrid system while maintaining the best possible energy flow in terms of system reliability (LPSP). The number of wind turbines, solar panels, batteries, and the rated power of the biomass gasifier were selected as four decision variables for system configuration. Hence, the objective function for the optimizing the HRES is given by:

Minimize: ASC

$$ {\text{ASC}} = N_{{{\text{SPV}}}} C_{{{\text{SPV}}}} + N_{{{\text{windT}}}} C_{{{\text{windT}}}} + N_{{{\text{batt}}}} C_{{{\text{batt}}}} + \rho_{{{\text{biomass}}}} C_{{{\text{biomass}}}} + \rho_{{{\text{inv\_con}}}} C_{{{\text{inv\_con}}}} $$
(18)

where \(C_{{{\text{SPV}}}}\); \(C_{{{\text{windT}}}}\); \(C_{{{\text{batt}}}}\); and \(C_{{{\text{inv\_con}}}}\) represent how much a solar PV panel costs (ZAR/kW), wind turbine cost (ZAR/kW), per unit battery cost (ZAR/kWh), and inverter and converter (ZAR/kW), respectively. \(C_{{{\text{biomass}}}}\) denotes the cost of biomass engine (per kW) and \(\rho_{biomass} { }\) denotes the rating of biomass engine, and \(\rho_{{{\text{inv\_con}}}}\) is the rating of the inverter and converter.

The installation components ASC consisting of four key variables, with each component's overall ASC may be stated as follows.:

$$ C_{{{\text{SPV}}}} = C_{{{\text{SPV\_Cap}}}} + C_{{{\text{SPV\_Rep}}}} + C_{{{\text{SPV\_O}}\& {\text{M}}}} - C_{{{\text{SPV\_Sal}}}} $$
(19)
$$ C_{{{\text{windT}}}} = C_{{{\text{windT\_Cap}}}} + C_{{{\text{windT\_Rep}}}} + C_{{{\text{windT\_O}}\& {\text{M}}}} - C_{{{\text{windT\_Sal}}}} $$
(20)
$$ C_{{{\text{batt}}}} = C_{{{\text{batt\_Cap}}}} + C_{{{\text{batt\_Rep}}}} + C_{{{\text{batt\_O}}\& {\text{M}}}} - C_{{{\text{batt\_Sal}}}} $$
(21)
$$ C_{{{\text{biomass}}}} = C_{{{\text{biomass\_Cap}}}} + C_{{{\text{biomass\_Rep}}}} + C_{{{\text{biomass\_O}}\& {\text{M}}}} - C_{{{\text{biomass\_Sal}}}} $$
(22)
$$ C_{{{\text{inv\_con}}}} = C_{{{\text{inv\_con\_Cap}}}} + C_{{{\text{inc\_con\_Rep}}}} + C_{{{\text{inv\_cov\_O}}\& {\text{M}}}} - C_{{{\text{inv\_con\_Sal}}}} $$
(23)

where \(C_{{{\text{Cap}}}}\), \(C_{{{\text{Rep}}}}\), \(C_{{{\text{O}}\& {\text{M}}}}\), \(C_{{{\text{Sal}}}}\) denotes capital and installation costs, replacement costs, annual maintenance and operating costs, and recycling/salvage costs.

Consequently, using the CRF, the cash value of money is determined as:

$$ {\text{CRF}}\left( {i,N} \right) = { }\frac{{i\left( {1 + i} \right)^{N} }}{{\left( {1 + i} \right)^{N} - 1}} $$
(24)

where \(N\) is the project life expectancy in years, and \(i\) shows the yearly interest rate.

A set of constraints for the optimization problem are:

$$ 1 \le N_{{{\text{SPV}}}} \le N_{{{\text{SPV\_max}}}} $$
(25)
$$ 1 \le N_{{{\text{windT}}}} \le N_{{{\text{windT\_max}}}} $$
(26)
$$ 1 \le N_{{{\text{batt}}}} \le N_{{{\text{batt\_max}}}} $$
(27)
$$ 1 \le N_{{{\text{biomass}}}} \le N_{{{\text{biomass\_max}}}} $$
(28)
$$ 1 \le N_{{{\text{biomass}}}} \le N_{{{\text{biomass\_max}}}} $$
(29)
$$ 0 \le {\text{LPSP}} \le {\text{LPSP}}_{\max } $$
(30)

In a perfect system, where energy is always produced to meet the load demand, LPSP = 0, while in a system, where the load is never met, LPSP = 1. To guarantee that LSLP is below a certain limit, this optimization first concentrates on the capacity of the biomass engine, batteries, and near-optimal size of PV modules, wind turbines, and batteries (0.2). It is crucial to optimize the system for the lowest overall yearly system cost because renewable energy systems are more expensive than fossil fuels (Yang et al. 2019; Foster et al. 2017).

Therefore, the optimal hybrid system configuration selected based on the levelized cost of electricity (LCOE) and reliability is estimated using the annualized system cost (ASC). The LCOE is calculated as follows:

$$ {\text{LCOE}} = \frac{{{\text{ASC}}\, \left( {{\text{cost of energy in}}\, \$ \, {\text{per year}}} \right)}}{{{\text{Total useful energy served }}\left( {\text{kWh per year}} \right)}} $$
(31)

The cost function or economic aspect sums the present net values of all the initial or capital investments, the replacement costs of the system components, the yearly operation and maintenance costs, the cost of the diesel generator, and the salvage values of the equipment and any other cost associated with the system. Having an objective function that minimizes the costs and produces reliable energy is ideal. The technical aspect of designing a reliable energy considers sizing of HRES that can meet the load demand. Table 2 sheds light on some recent objective function strategies of HRES.

Table 2 Examples of some recent HRES optimization and their objectives

The technical aspect of designing a reliable energy considers sizing of HRES that can meet the load demand.

From Table 2, it is observed that most HRES configurations are designed with multiple objectives such as minimizing cost and at the same breath maximizing power reliability.

Mostly, the cost function is being optimized, thus the objective function of a hybrid energy system aims at minimizing either energy cost that is levelized cost of energy (LCE) or net present value (NPV). The LCE is the ratio of the total cost of the hybrid system to the amount of energy supplied by the system per annum while the NPV includes the capital cost of the system components as well as the replacement and maintenance cost of the system for its entire life span. Other cost-related optimization criteria for HRES are life cycle cost (LCC), annualized system cost (ASC), capital cost (CC), and many more.

Reliability criteria satisfy desired reliability levels based on certain probabilities estimations. A common measuring criterion is loss of power supply probability (LPSP). This is the probability that the attached load will encounter an insufficient power supply. Mostly, to determine LPSP, it has to be monitored to ensure that the likelihood of the HRES not meeting the load demand is always kept very low or approximately zero. The reliability criteria for power loss constraint of a hybrid system LPSP are usually defined between 0 and 1. When LPSP is evaluated as 1, it means the load will never be satisfied, and a zero (0) value means that the load will always be satisfied, hence the power loss constraint is modeled to have the least possible value but meet the load demand often. Another common reliability criteria are loss of load probability (LOLP).

Technically, the power generated by each renewable source cannot exceed its maximum capacity. Similarly, the power balance constraint guarantees that the total power generated by the hybrid system makes up for total load demand, total power loss, and storage power if it is available. The battery constraints are set so that at any given time the SOC is maintained within a desirable threshold. When the battery’s SOC falls below a minimum allowable limit it compromises the system's reliability.

3 Methodology

An effective approach to cost-effectively generate a reliable power supply from the hybrid system is to optimize the components of the hybrid system. Optimizing a hybrid renewable energy system is a multidimensional problem. There could be multiple but conflicting targets and myriad random variables (Kumar et al. 2018) as HRES encompasses multiple renewable energy systems. Recent reviews of models and methods to assess an optimal configuration of HRESs are presented in Faccio et al. (2018); Frimpong et al. 2021). Several techniques or approaches for the preliminary assessment of HRESs include commercial software such as HOMER, hand-made approaches, and computational tools including AI techniques such as PSO, GA, and TLBO.

The optimization strategy in this current study is based on the social spider prey (SSP) algorithm, which considers the random vibration of prey in the social spider's web. In this algorithm, a captured prey spreads its presence on the web, disrupting the state of equilibrium of the social web; it does this by making the web vibrate. This vibration is different from that generated by social spiders. In addition, the vibrations generated by a prey provide information about its weight. It is important to note that many preys can be caught on the web at the same time.

3.1 Mathematical model of the SSP

The vibration intensity transmitted across the web is given as:

$$ I_{{{\text{Prey}}}} = \left\{ {\begin{array}{*{20}l} {\frac{1}{{1 + f\left( {X_{i} } \right)}},} & { f\left( {X_{i} } \right) \ge 0} \\ {1 + abs\left( {f\left( {X_{i} } \right)} \right),} & {f\left( {X_{i} } \right) < 0} \\ \end{array} } \right. $$
(32)

where \(f({X}_{i})\) is the fitness value of the prey \({X}_{i}\). The vibration of the prey spread across the web at a frequency \(f\) signifies the freshness and sustainability of the prey on the web, and it is computed as:

$$ \xi = \frac{1}{2}\pi \sqrt{\frac{k}{m}} \times {\text{rand}} $$
(33)

where \(\xi\) represents frequency (f), k is the maximum intensity and m is the prey intensity, a random number of rand \(\in \left( {0,} \right.\left. 1 \right)\) represent captured or escaped prey. The position of prey on the social web is expressed as:

$$ X_{{{\text{Prey}},i}}^{r} = X_{i}^{r} + \xi \left( {X_{{{\text{best}},\;{\text{prey}}}}^{r} - X_{{{\text{average}},\;{\text{prey}}}}^{r} } \right) $$
(34)

where \(X_{{{\text{Prey}},\;i}}^{r}\) is the new position of the ith prey, \(X_{{{\text{best}},\;{\text{prey}}}}^{r}\) is the position of the best-found prey, and \(X_{{{\text{average}},\;{\text{prey}}}}^{r}\) is a derived prey with the average value of prey along the decision variables relative to the best position so far.

Captured prey information is disseminated through the social web to inform spiders of the actions to be taken. Subsequently, artificial spiders search to locate prey on the social web, that is, hyperdimensional search space. Each spider stores its location, vibration, and other parameters that drive its search mechanism. Every vibration detected by a spider has a source and intensity. The vibration intensity \(I\) generated and perceived by other spiders at time t is given by the Equation:

$$ I\left( {P_{a} , P_{b} ,t} \right) = \log \left( {\frac{1}{{f\left( {P_{s} } \right) - C}} + 1} \right) $$
(35)

where \(I\left( {P_{a} , P_{b} ,t} \right) \) denotes the source intensity between search agents a and b, \(f\left( {P_{s} } \right)\) is the spider's assessed fitness value, \(C\) is a small constant estimated to be less than the value of any objective function, and \(P_{a} , P_{b} \) represent the source and destination of the vibration. The rate of attenuation of the vibration over distance and its destination is given by the 1 norm Manhattan distance. The Manhattan distance is consistently preferable to the Euclidean distance metric for high-dimensional data mining applications (Aggarwal et al. 2001), and this is the case for the HRES optimization problem. Hence, the attenuation over distance is given by:

$$ D\left( {P_{a} , P_{b} } \right) = \left\| {P_{a} - P_{b} } \right\| $$
(36)

Now the vibration intensity received by a spider is calculated according to the Equation:

$$ I\left( {P_{a} , P_{b} ,t} \right) = \user2{ }I\left( {P_{a} , P_{a} ,t} \right) \times \exp \left( {\frac{{ - D\left( {P_{a} , P_{b} } \right)}}{{\sigma \times r_{a} }}} \right) $$
(37)

where \({r}_{a}\) represents a user-controlled parameter that controls the attenuation rate of the vibration over distance, and \(\sigma \) is the standard deviation of all spider positions along the dimensions. Moreover, spiders utilize dimensional mask \((\mathrm{dm})\) changing and random walk to move from one position to the other with the help of the following position given by Eq. (24). The \(\mathrm{dm}\) is made up of a binary vector whose elements are zeros and ones, and its length equals the dimension of the optimization problem. The algorithm initializes all the elements of \(dm\) with zeros, but in each iteration, a spider changes its mask value using a probability of \({1-P}_{c}^{n}\) where \({P}_{c}^{n}\) \(\in (\mathrm{0,1})\). If the mask is decided to be changed, each bit of the vector has a probability of \({P}_{m}\) to be assigned with a 1 and \({1-P}_{m}\) to be assigned a zero.

$$ P_{{k, {\text{follow}},\left( r \right)}}^{t} = \left\{ {\begin{array}{*{20}c} {P_{{k, {\text{target}}, \left( r \right)}}^{t} \;\; if\; m_{k, \left( r \right)}^{t} = 0 } \\ {P_{{k, {\text{random}}, \left( r \right)}}^{t} \;\; if\; m_{k, \left( r \right)}^{t} = 1 } \\ \end{array} } \right. $$
(38)

Once the following position is generated, each spider performs a random walk (Yu and Li 2018) using Eqs. (25) and (26) as follows:

$$ P_{k}^{t + 1} = P_{k}^{t} + PM_{k} \times {\text{rand}}_{k} + \left( { P_{{k,{\text{follow}} }}^{t} - P_{k}^{t} } \right) \odot R $$
(39)
$$ PM_{k} = P_{k}^{t} - P_{k}^{t - 1} $$
(40)

where R is a vector of uniformly generated random numbers from zero to one and \(\odot\) denotes elementwise multiplication as discussed in Yu and Li (2018).

The following assumptions underpin the operating strategy for the proposed HRES.

  • When the total power generated by solar panels and wind turbines is sufficient and the wind energy is less than the load, the demand can only be met by renewable sources. After the load has been satisfied, excess power can be supplied to the battery bank

  • If the electricity generated solely from wind turbines is sufficient to cover the load demand, the remaining electricity is fed into the battery bank

  • When solar PV panels and wind turbines do not generate enough power, the balancing power can be supplied by the battery

  • When solar and wind power are insufficient and batteries are also unable to generate the desired power to meet the load demand, the biomass engine supplies power to the load.

In this system, the biomass engine operates when the solar PV, wind turbines, and batteries bank cannot meet the load demand. Therefore, the model takes these conditions and trade-offs into account during the optimization process to make this important decision. Considering the set conditions, the main purpose is to optimize the hybrid system for better performance while achieving the optimization goal. Figure 5 shows the flowchart of the operational strategy for the HRES.

Fig. 5
figure 5

Flowchart of the operational strategy for the proposed HRES

In this study, the objective function was considered in terms of minimum levelized cost of energy (LCE) and loss of power supply probability (LPSP). Thus, the objective is to minimize economic expenditure while maintaining a maximum of 1% LPSP. The optimization results, therefore, consisted of the total number of the rated solar PV panels, the number of specified wind turbines, the number of batteries, and the maximum capacity rating of the biomass gasifier. The inverter was not considered as a decision variable but estimated the inverter using the peak load demand value as 25 kW to maintain the load flow balance.

The SSP algorithm is employed to design an optimal stand-alone PV–wind–biomass–battery hybrid system to generate a reliable power supply to the load attached to the system. The load has a varying distribution characteristic with an estimated peak load demand of 25 kW. Economic and reliability indicators were used to deduce the optimal size of each renewable technology whose combinations optimally meet the load demands.

4 Experiment settings and data acquisition

The experiment settings involve setting the parameter for the HRES. The parameters definition shown in Table 3 constitutes the technical composition of the solar PV, wind turbine, biomass, etc., for the renewable hybrid system.

Table 3 Parameter definitions for HRES components and system

The maximum number of PV panels, wind turbines, and batteries, as well as the maximum capacity rating of biomass gasifiers, were set to 500, 500, 1000, and 50, respectively. The near-optimal solution of a hybrid system is calculated by considering the possible configurations of the system that meet the load demand according to the availability of renewable energy resources, and the specified constraints. Hence, each feasible configuration is considered to supply sustainable power to the load for the 20 years system lifetime.

In the experiments conducted, four (4) different scenarios are considered indicating the set of possible combinations of the renewable energy technologies, helping to identify the best combination for the optimization problem. The possible combinations include wind–biomass–battery; PV–wind–biomass; PV–biomass–battery; and PV–wind–biomass–battery. The selected comparative algorithms were considered in each scenario to identify the best fit while the time step is one hour, and it was run on one year period dataset.

One of the reliability criteria is that any solution must be less than 1%, which is a constraint for an optimal solution. In these experiments, any solution with the least economic value or COE that satisfies this reliability criterion is considered the near-optimal solution.

Choosing the appropriate parameter values for the proposed method for a real optimization problem like the optimal dimensioning of HRES is undoubtedly a challenging task. This process involves identifying the range of values for the given parameters of an optimization algorithm and fine-tuning the values to yield the optimal, or even better, near-optimal value for a given problem. The techniques used by scientists to identify a parameter value are generally classified into two categories, offline and online parameter initialization (Yu and Li 2018). The offline scheme involves fixing the parameter value before running the algorithm. Also known as an endogenous strategy, this approach uses empirical or theoretical knowledge of the properties of the parameter to find the value (Yu and Li 2018) The online parameter initialization process, also known as the exogenous strategy, uses deterministic or adaptive schemes to change the parameter value during algorithm execution.

The fixed parameter scheme was used to test the performance of SSP compared to other algorithms whose parameters were set in a similar way. The algorithms PSO, TLBO, and SSA were parameterized. PSO has starting and ending weights set to 0.4 and 0.9, respectively. SSA has an attenuation rate (1.0); mask change probabilities are set to 0.7 and 0.1, respectively. TLBO has 30 teachers. The optimal parameters of SSP have been reported in previous research in Frimpong et al. (2020).

Historical energy-related data for solar PV and load demand were utilized. This historical data on load demand, solar irradiation, ambient, and wind speed, were retrieved from the National Renewable Energy Laboratory (NREL) in 2021 (PVWatts Calculator 2023) for the experiments. Hourly data are used for optimization processes, the monthly mean values of the solar irradiation, ambient, wind speed, and biomass data, and the monthly mean values of the load (kW) are shown in Table 4.

Table 4 Monthly data from historical source

The trend of sampled ambient temperature, solar radiation, and wind speed over a year are shown in Figs. 5, 6, 7.

Fig. 6
figure 6

Hourly solar irradiance for a year

Fig. 7
figure 7

Hourly wind speed for a year

To evaluate the experimental results obtained by the SSP algorithm, three comparative algorithms, namely the PSO, TLBO, and SSA, were utilized. These comparative algorithms were selected because of their simplicity and ease to understand the code and good convergence speed. Ten (10) independent runs were executed in each comparative algorithm during the experiments as it guaranteed optimality, where each run consists of 60 iterations. Solar irradiance, ambient temperature, wind speed, biomass volume, and load data were the input to the hybrid system models to determine the economic and reliability of the power supply (Fig. 8).

Fig. 8
figure 8

Hourly ambient temperature for a year

5 Results and analyses

This section presents the results and analyses of each hybrid renewable energy mix in terms of their economic and reliability criteria, and convergence curves of the feasible solutions.

5.1 Economic and reliability analysis of renewable energy mix

5.1.1 Scenarios 1: wind–biomass–battery

Scenario 1 considered the wind–biomass–battery combination. The sizing optimization of the multi-source renewable system was considered using these algorithms, whereas the optimal configuration of wind–biomass–battery and its energy analysis was provided. In this experiment, the objective function was considered in terms of minimum levelized cost of energy (LCE) and loss of power supply probability (LPSP). Thus, the objective is to minimize economic expenditure while maintaining a maximum of 1% LPSP. Table 5 presents the average results of each algorithm after the 10th run.

Table 5 Configuration of wind–biomass–battery and comparative algorithm

Table 5 shows the result obtained and comparatively, the SSP algorithm produced the LPSP value of 0.011, whereas SSA produced the LPSP value of 0.004. The LPSP value is expressed as 0 and 1, where the LPSP value of 1 signifies that the load will never be satisfied, whereas the LPSP of 0 value means that the load will always be satisfied. A lower LPSP ratio corresponds to a higher levelized cost of energy (LCE). Thus, the optimal reliable solution of 0.004 corresponding to the wind–biomass–battery configuration is 0 for PV panels (0), number of wind turbines (115), number of batteries (321), gasifier rating (11), and biomass (592). Economically, this translates to a higher cost of 5.6137 (ZAR/kWh) approximately 0.31 USD $/kWh. Thus, higher reliability incurs a higher cost for the wind–biomass–battery hybrid system.

SSA used a higher number of batteries (321) and gasifier ratings (11), thus leading to higher reliability (0.004) which should be approximately zero (0). Though the SSA performs well in terms of reliability, the SSP was most optimal as it satisfies all the constraints set in this experiment.

Annualized system cost (ASC in ZAR) of the comparative algorithms of SSP, TLBO, SSA, and PSO are 3,431,512.26; 3,718,603.24; 3,720,196.95; and 3,540,940.75, respectively. The net present value (NPV) of the system as derived from the various optimization algorithms utilized are SSP (ZAR15,994,131.58), TLBO (ZAR17,332,250.36), SSA (ZAR17,339,678.57), PSO (ZAR16,504,173.07), respectively, with the proposed SSP algorithm having the least estimated cost. Accordingly, a unit cost of energy in R/kWh is estimated as 5.1781, 5.6113, 5.6137, and 5.3432 with the comparative algorithms SSP, TLBO, SSA, and PSO, respectively. The SSP produced the optimal cost of energy as 5.1781 (ZAR/kWh) approximately 0.29 USD $/kWh or ZAR5.1781 $/kWh. The SSP optimal solution offers a better economic value for the hybrid system and also satisfies the reliability criteria adequately. Thus, suggesting an initial capital cost of ZAR4,129,800.00 is required to set up the hybrid wind–biomass–battery system.

Having identified SSP as the algorithm that meets the reliability and economic criteria for the hybrid wind–biomass–battery, further analysis shown in Table 6 was conducted to understand how much investment can be committed to running a wind–biomass–battery system for a year and also how much initial capital is required to start its deployment.

Table 6 SSP algorithm, NPV, and ASC for wind–biomass–battery system

Table 6 details the cost constituents in terms of the net present value of the hybrid system. For each component, the SSP estimated the total capital cost (ZAR4,129,800.00), replacement cost (ZAR1,745,203.16), operation and maintenance cost (ZAR8,994,285.35), the salvage cost (ZAR18,202.39), and the ASC (ZAR3,431,512.26). In addition to the four cost factors of the hybrid system, fuel cost is also considered for the biomass gasifier which depends on the number of hours it runs yearly. Thus, the results demonstrate that the combination of only wind and battery could not meet the load demand especially when battery state of charge is at its minimum then biomass gasifier kick starts.

5.1.2 Scenarios 2: solar PV–wind–biomass without battery storage

Scenario 2 considered solar PV–wind–biomass without battery storage system. Table 7 depicts the optimal solution for the solar PV–wind–biomass system configuration for Scenario 2.

Table 7 Configuration of solar PV–wind–biomass and comparative algorithms

Table 7 shows the results, and it is observed that the estimated minimum cost of energy is R3.8476 per kWh for the SSP algorithm. The estimates for the TLBO, SSA, and PSO are 3.9296, 3.96296, and 3.9801. This suggests that the SSP algorithm guarantees the optimal number of solar PV (189), wind turbines (101), and rating of the biomass gasifier (9) and the cost of energy is 3.8476 R/kWh. Additionally, both SSP and TLBO estimated LPSP as 0.0011. It is observed that both SSP and TLBO evaluated LPSP as 0.0011, whereas SSA and PSO estimated 0.01 and 0.0012, respectively. All the estimated LPSP values are within the system constraints, and they all show a very highly reliable system that can supply power almost all year round. Thus, per the results obtained by SSA and TLBO in terms of LPSP index, the PV–wind–biomass hybrid system has more than 99.99% chance of meeting the attached load throughout the year except for only 0.004015 days per year where the hybrid system could not meet the load attached to the system. It is also observed that the net present value (NPV) are SSP (ZAR11, 884, 474.55), TLBO (ZAR12, 137, 761.92), SSA (ZAR12, 246, 260.68), and PSO (ZAR12, 293, 751.00).

The SSP algorithm guaranteed the least estimated net present cost for the system. Moreover, a unit cost of energy in R/kWh is estimated as 3.8476, 3.9296, 3.9647, and 3.9801 with the comparative algorithms SSP, TLBO, SSA, and PSO, respectively. Having identified that the SSP algorithm satisfies the reliability and economic criteria for the hybrid PV–wind–biomass system, further analysis to understand the yearly economic commitment was conducted using the SSP as shown in Table 8.

Table 8 SSP algorithm, NPV, and ASC for solar PV–wind–biomass

Table 8 shows the costing constituents in terms of capital cost, replacement cost, operation, and maintenance cost, recycling cost, and the optimal cost. For each component, SSP estimated the total capital cost (ZAR6,181,800.00), replacement cost (ZAR0.00), operation and maintenance cost (ZAR4,888,455.59), salvage cost (ZAR85,418.18), and the ASC (ZAR2,549,792.71). In addition to the four cost factors of the hybrid system, the fuel costs are also considered with the biomass gasifier, which depends on the operating hours in a year.

The result of this experiment using solar PV–wind–biomass suggests that the lesser the gasifier for producing power, the lower its operation and maintenance cost, and the greater its salvage cost. Eventually, the PV–wind–biomass system is far cheaper and more reliable compared to the wind–biomass–battery hybrid system. Thus, though the solar PV–wind–biomass was without a battery storage system, it is reliable and economically viable as compared to the system configuration of Scenario 1.

5.1.3 Scenarios 3: solar PV–biomass–battery

Scenario 3 considered a solar PV–biomass–battery combination. Table 9 depicts the case of solar PV–biomass–battery system configuration.

Table 9 Configuration of solar PV–biomass–battery system and comparative algorithm

Table 9 shows the results, and it is observed that the SSP guaranteed a minimum energy cost of 2.4727 ZAR per kWh, whereas the SSA (2.5257 ZAR per kWh), PSO (2.5922 ZAR per kWh), and TLBO (2.6514 ZAR per kWh). This suggests that the SSP guaranteed the best result followed by SSA.

Again, the SSP and SSA estimated an LPSP index of 0, suggesting that the combination of solar PV and battery storage systems minimizes the biomass gasifier rating. Meanwhile, for the hybrid system reliability index, LPSP per the calculation shows a highly reliable system that can provide almost all year-round power supply. The estimated LPSP values according to the various optimization techniques SSP, SSA, PSO, and TLBO are 0.00021, 0.00019, 0.00023, and 0.00014, respectively. These results indicate that there is a high probability approximately 99.98% that the hybrid PV–biomass–battery hybrid system would meet the load demand throughout the year. It is also observed that SSP and SSA estimated one unit of the rated gasifier, PSO (2 units), and TLBO (2 units).

The net present value (NPV) of the respective algorithms are SSP (ZAR7,637,578.71), TLBO (ZAR8,189,661.65), SSA (ZAR7,801,524.43), and PSO (ZARR8,006,981.62). Also, the ASC of the respective algorithms are TLBO (ZAR1,757,077.23), PSO (ZAR1,717,883.55), SSP (ZAR1,638,628.82), and SSA (ZAR1,673,803.08).

Having identified that the SSP algorithm can satisfy the reliability and economic criteria for the solar PV–biomass–battery system, further analysis of the yearly economic feasibility shown in Table 10 can provide a better understanding of how to run the solar PV–biomass–battery.

Table 10 SSP algorithm, NPV, and ASC for PV–biomass–battery hybrid system

Table 10 shows the results, and it is observed that the SSP estimated capital cost is (ZAR1,721,200.00), replacement cost (ZAR1,006,292.90), operation and maintenance cost (ZAR4,697,848.51), recycling cost (ZAR6,505.64), and ASC (ZAR1,638,628.82).

5.1.4 Scenarios 4: solar PV–wind–biomass–battery

Scenario 4 consists of a solar PV–wind–biomass–battery system. The reliability and economic feasibility of the comparative algorithm results are shown in Table 11.

Table 11 Configuration of PV–wind–biomass–battery system and comparative algorithm

From Table 11, it is observed that SSP (ZAR2.1309 per kWh) guaranteed optimal cost of energy among the comparative algorithms. It is observed that the comparative algorithms produced LPSP values that are within the boundary constraints, where SSP outputs LPSP value of 0.0141, TLBO (0.0121), PSO (0.0133), and SSA (0.0212). The SSP algorithm estimated solar PV (42), wind turbine (1), biomass gasifiers (2), and batteries (201), respectively. Also, TLBO estimated solar PV (43), wind turbine (2), biomass gasifiers (1), and batteries (201), respectively; the PSO estimated solar PV (44), wind turbine (2), biomass gasifiers (1), and batteries (202), respectively; and the SSA also outputs solar PV (45), wind turbine (1), biomass gasifiers (1), and batteries (203), respectively. This suggests a relatively low number for solar PV, wind turbines, and biomass gasifiers.

Further analysis of reliability and economic constraints is presented in Table 12 for the hybrid PV–wind–biomass–battery configuration.

Table 12 SSP algorithm, NPV, and ASC for PV–wind–biomass–battery system

From Table 12, it is estimated that an amount of ZAR6,581,936.45 is required to set up a hybrid PV–wind–biomass–battery system, whereas the capital cost (ZAR1,586,400.00), replacement cost (ZAR938,440.60), operation and maintenance (ZAR4,067,671.15), and salvage cost (ZAR28,350.00) are observed. This suggests that solar PV, wind turbines, biomass gasifier, and battery storage system complement one another to the optimum and provide a sustainable power supply that meets load demand.

5.2 Convergence curves analysis of hybrid renewable system

Figures 9, 10, 11, and 12 depict the convergence curve of the four nature-inspired optimization algorithms. The y-axis depicts the average COE and the x-axis is the number of iterations. The convergence curve of the comparative algorithms concerning the levelized cost of energy is shown in Fig. 9, where it is observed that PSO starts iterating at a lower average COE but converges at 5.3432 (ZAR/kWh), whereas SSA starts with the highest average COE and converges at 5.6137 (R/kWh). Though the SSP algorithm starts iteration with an average COE above 25R/kWh, it has the best convergence (5.1781 ZAR/kWh) among the comparative algorithms (Tables 13, 14).

Fig. 9
figure 9

Convergence curves of comparative algorithms for Scenario 1 (wind–biomass–battery)

Fig. 10
figure 10

Convergence curves of comparative algorithms for Scenario 2 (solar PV–wind–biomass without battery)

Fig. 11
figure 11

Convergence curves of comparative algorithms for Scenario 3 (solar PV–biomass–battery)

Fig. 12
figure 12

Convergence curves of comparative algorithms for Scenario 4 (solar PV–wind–biomass–battery)

Table 13 computational complexity of algorithms
Table 14 Hypothesis test summary and asymptotic significance

Figures 13, 14, 15, and 16 show the various components and their contributions to the total power supplied to the electrical load attached to the hybrid system for Scenario 1.

Fig. 13
figure 13

Biomass power output and total load served under Scenario 1 (wind–biomass–battery)

Fig. 14
figure 14

Wind turbine power output and total load served under Scenario 1 (wind–biomass–battery)

Fig. 15
figure 15

Battery input power and total load served under Scenario 1 (wind–biomass–battery)

Fig. 16
figure 16

Battery state of charge for Scenario 1 (wind–biomass–battery)

The rate biomass gasifier supplied up to 10 kWh of energy to the hybrid system whenever the primary sources, wind, and battery could not provide sufficient energy. The biomass could not meet the load demand above 10KWh. However, it is also observed that biomass at 2KWh was producing energy that could not meet the load demand for any given time throughout the year. Thus, this suggests that biomass was used with other power systems, i.e., wind or battery in Scenario 1.

As shown in Fig. 14, enough wind turbine is available to meet the load demand. However, the wind was unable to meet load demand, another source of energy compensated in energy production.

Figure 15 indicates that the battery was able to provide enough power to meet the load demand because excess power generated by the wind was at its peak per year.

Figure 16 shows the state of charge (SOC) of the battery utilized. It was observed that the battery cannot charge above 100% and also not below 40% SOC.

Figures 17 and 18 show various components and their contributions to the total power delivered to the electrical load connected to the PV–wind–biomass hybrid system as configured in Scenario 2.

Fig. 17
figure 17

Biomass power output and total load served under Scenario 2 (solar PV–wind–biomass without battery)

Fig. 18
figure 18

Solar PV power output and total load served under Scenario 2 (solar PV–wind–biomass without battery)

From Scenario 2, as shown in Fig. 19, it can be seen that in the solar PV–wind–biomass configuration, the hybrid system generated a significant amount of solar energy to alleviate the huge power deficit that the biomass gasifier and the wind turbine could not cover.

Fig. 19
figure 19

Power output from the wind turbine and total load served under Scenario 2 (solar PV–wind–biomass without battery)

From Scenario 3, Figs. 20, 21, 22, and 23 show different components and their contribution to the total power delivered to the electrical load connected to the PV–biomass–battery hybrid system.

Fig. 20
figure 20

Biomass power output and total load served under Scenario 3 (solar PV–biomass–battery)

Fig. 21
figure 21

Solar PV power output and total load served under Scenario 3 (solar PV–biomass–battery)

Fig. 22
figure 22

Battery input power and total load served under Scenario 3 (solar PV–biomass–battery)

Fig. 23
figure 23

Battery state of charge for Scenario 3 (solar PV–biomass–battery)

From Scenario 4, Figs. 24, 25, 26, 27, and 28 show different components and their contributions to the total power delivered to the electrical load connected to the PV–wind–biomass–battery hybrid system for Scenario 4. The battery storage system performance and the SOC for the complete year period are also shown in Fig. 24.

Fig. 24
figure 24

Biomass power output and total load served under Scenario 4 (solar PV–wind–biomass–battery)

Fig. 25
figure 25

Wind turbine power output and total load served under Scenario 4 (solar PV–wind–biomass–battery)

Fig. 26
figure 26

Solar PV power output and total load served under Scenario 4 (solar PV–wind–biomass–battery)

Fig. 27
figure 27

Battery input power and total load served under Scenario 4 (solar PV–wind–biomass–battery)

Fig. 28
figure 28

Battery state of charge for Scenario 4 (solar PV–wind–biomass–battery)

Among the four Scenarios experimented, the fourth consisting of the solar PV module, wind turbine, biomass gasifier, and battery storage hybrid system is the best solution in terms of economic value for the hybrid system configuration. The optimal solution also has a high level of reliability for a year-round power supply. Figure 28 also shows that the incorporation of PV solar modules, wind turbines, biomass gasifiers, and battery storage systems have both economic and reliable advantages in achieving a sustainable power supply.

6 Computational complexity

There are two factors to determine complexity of algorithm that is time and space complexity (Agushaka et al. 2022). The time complexity determines the amount of computing time required to run algorithm to completion, whereas the space complexity is the amount of memory needed to run algorithm to completion. The computational complexity measures the time that the CPU needs to run the algorithm. Alternatively, the complexity is measured by the number of nested loops per run expressed as O(x) where x is the nested loops. The level of complexity can be scaled as very high, high, low, and very low. An algorithm with minimum value is chosen. In this paper, the computing time was used, where the time required to run the algorithms as detailed in Agushaka et al. (2022) was used, where the T1 is the computing time, and T2 is the mean time. The value of (T2 − T1)/T0 gives the complexity of the respective algorithm. T0 is the initial computational time where x is 0.1 for 60 iterations. The algorithms are implemented using MATLAB R2020b, Windows 10 operating system, Intel Core i7-7700@3.60 GHz CPU, and 16G RAM.

SSP returned the minimum values compared to the other algorithms. Conclusively, the computational complexity of the SSP is relatively low and easy to implement. PSO has maximum value, suggesting that it suffers high computational complexity.

The computational complexity of most metaheuristic algorithms essentially depends on three factors, namely the initialization process, the evaluation of the fitness function, and the updating of the intermediate solutions in the optimization process (Abualigah et al. 2021; Dieterich and Hartke 2012). Similarly, the computational complexity of the SSP algorithm is assessed based on these assumptions. First, the complexity of the initialization process of the proposed method is \(O(N)\), where \(N\) represents the population size. Second, the computational complexity of the fitness function evaluation depends on the optimization problem, and here on the objective function of the HRES optimization problem given in Eq. (1), which is of \(O(1)\) since the objective function is a linear equation depicting the sum of the various components. Finally, the computational complexity of updating the intermediate solution is \(O\left(N\times M \right)+O\left(N\times M\times L\right)\), where \(M\) is the number of iterations and \(L\) is the problem dimension. Therefore, the computational complexity of the proposed method is \(O(N \times (ML +2)\)).

7 Statistical analysis

To realize the statistical significance of the implemented algorithms, Kruskal–Wallis test is performed on the convergence values of the comparative algorithms. The Kruskal–Wallis test is a nonparametric analysis of variance which is often used instead of a standard one-way ANOVA when data are from a suspected non-normal population (Vargha and Delaney 1998). The procedure tests for some differences between groups. Usually, comparison of means across 3 or more groups is commonly performed using a parametric analysis of variance (ANOVA) procedure. When data do not meet ANOVA assumptions of normality, but the data are continuous, independent, and variances are homogenous, a nonparametric test can be used to perform an omnibus test that the group distributions are different. Essentially, this test determines if the groups have the same median, hence the Kruskal–Wallis test does not assume normally distributed data.

To identify the significant combination of means or pairwise differences, a multiple comparison test is typically performed utilizing a procedure that controls for the overall (experiment-wise) significance level. Interpretation of the significant difference is then based on these results. Instead of a hypothesis based on means, the null hypothesis for the Kruskal–Wallis is that the data are from population with the same location. The test is based on an analysis of means ranks. To perform a Kruskal–Wallis test, the ranks of the data values are assigned to calculate the test statistic, H, given by:

$$ H = \frac{12}{{N\left( {N + 1} \right)}}\mathop \sum \limits_{i = 1}^{k} \frac{{R_{i}^{2} }}{{n_{i} }} - 3\left( {N + 1} \right) $$
(41)

where N denotes the total sample size, k is the number of groups that are been compared, Ri is the sum of ranks for group \(i\), and \({n}_{i}\) is the sample size of group \(i\).

The H to a critical cutoff point is determined by the Chi-square distribution (Chi-square is used because it is a good approximation of H, especially if each group’s sample size is >  = 5). If the H statistic is significant (H is larger than the cutoff) then we reject the null hypothesis; otherwise, the H statistic is not significant (H is smaller than the cutoff) we fail to reject the null hypothesis. In this stance, the null hypothesis is that the medians of each group are the same for each algorithm’s convergence data points as they were all generated with the same parameter settings. This means that all groups come from the same distribution. The alternative hypothesis is that at least one of the groups has a different median, meaning at least one comes from a different distribution than the others.

To determine how the comparative algorithms (SSP, TBLO, SSA, and PSO) perform compared to each other, this can be quantified by determining if each algorithm produce the same fitness values by verifying that the algorithms exhibited the same data distribution. The value of p less than 0.05 indicates the statistical importance among the algorithms. The results are depicted in Table 15. The mean, standard deviation (SD), median along with other statistical parameters were obtained for the evaluated fitness values distribution.

Table 15 Statistical parameters of comparative algorithms

In Table 16, each row tests the null hypothesis that Algorithm 1 and Algorithm 2 distributions are the same. The significance values have been adjusted by the Bonferroni correction for multiple tests. The test results showing the pairwise comparisons of comparative algorithms in Table 16.

Table 16 Pairwise comparisons of objective values

The adjusted significance of the critical alpha value for all the pairs is >  = 0.05. Figure 29 shows the pairwise comparison of the algorithms; nodes a, b, c, and d represent SSP, TLBO, SSA, and PSO, respectively.

Fig. 29
figure 29

Pairwise comparison of algorithm showing the sample average rank

The independent samples Kruskal–Wallis test reveals different means among the comparative algorithms. Figure 30a–d represents SSP, TLBO, SSA, and PSO, respectively.

Fig. 30
figure 30

Independent samples Kruskal–Wallis test showing different means among algorithms

The pairwise comparison of the algorithms along with their significance level is presented in Table 17 and F.

Table 17 Pairwise comparisons of algorithms statistics

From the Kruskal–Wallis test, it is observed that H is larger than the critical cutoff for SSP-TLBO, SSP-SSA, TLBO-SSA, T LBO-PSO, and SSA-PSO, hence we reject the null hypothesis; thus, the medians are not the same across all four groups, at least one of them has a different median than the others. However, it is interesting to note that there is SSP-PSO turned out to have same distribution from the statistical result as the significance value and the adjusted significance are < 0.001 and 0, respectively. This means that all 4 algorithms do not perform equally, hence there is significant difference among the algorithm performance in identifying the global optimum.

8 Discussion of results on economic and reliability criteria

The economic performance of the hybrid system is evaluated using the net present value method for investment decisions since this cost that occurs in the future is discounted to present value. The initial investment costs occur once during the installation of the system. They are calculated based on costs per unit component and the total capacity of each component.

The comparative algorithms estimated different sizing and varying cost for each scenario. In Scenario 1, the NPV estimation given by the SSP, TLBO, PSO, and SSA is ZAR15, 994,131.58; ZAR17, 332, 250.36; ZAR16, 504,173.07; and ZAR16,504,173.07, respectively, with the SSP and TLBO having the least and maximum values, respectively. Scenario 1 was the most unattractive because it resulted in the highest cost per unit of electric power produced. Scenario 4 had the best NPV and ASC (ZAR1,412,142.80) from the SSP algorithm, whereas the ASC values of TLBO are (ZAR1,418,942.87), PSO (ZAR1,428,007.43), and SSA (ZAR1,441,996.17), respectively. Scenario 4 provided the most suitable cost benefits considering the amount for the unit cost of energy produced by the proposed hybrid system. The optimal COE solutions per each algorithm are SSP (2.13ZAR/kWh), TLBO (2.14ZAR/kWh), PSO (2.16ZAR/kWh), and SSA (2.16ZAR/kWh). The SSP outperformed the comparative algorithms from the economic perspective. The COE obtained by the SSP algorithm shows that the proposed PV–wind–biomass–battery system (Scenario 4) can provide a reliable energy supply to the study area at an acceptable cost. The results provide good reason to consider the output of the proposed SSP algorithm that yielded the least COE. Therefore, for detailed economic and reliability discussion, results obtained by the SSP algorithm may be chosen as the optimal combination.

Similar studies on the economic aspect of energy optimization by Sandeep and Nandihalli (2020), incorporated solar PV and wind and applied opposition-based social spider optimization (OSSO) for hybrid solar PV–wind power system configuration. The outcome of the study suggested that OSSO generated a minimum cost of “$7040.642” which was lesser than the comparative algorithms, namely AGACauchy, PSO, AFSO, and SSO. Meanwhile, the OSSO estimated the number of solar PV (81), the number of wind (1), and the number of batteries (12). Unfortunately, none of the scenarios considered in our study is similar to the hybridization approach adopted by Sandeep and Nandihalli (2020).

Singh et al. (2016) hybridized solar PV–wind–biomass–storage and applied an artificial bee colony (ABC) algorithm for size optimization of their hybrid system. Their findings were compared with HOMER and PSO which indicated that the ABC algorithm has good convergence properties and produced good quality results in terms of optimal configuration. Scenario 2 of our experiment is the same hybridization approach adopted by Singh et al. (2016). Comparatively, the ASC obtained by ABC algorithm are capital (55,108$/yr), replacement cost (5,111$/yr), maintenance cost (3,571$/yr), salvage cost (-1071$/yr), and total energy cost (63,006$/yr). Our proposed SSP cost (USD 141,461.43) is higher than the algorithm ABC algorithm by Singh et al. (2016).

Nafeh (2011) hybridized solar PV–wind incorporating storage battery and applied GA as the optimization approach to determine the total cost and reliability (LPSP technique) constraint. The finding suggests that the total cost of solar PV–wind ($57,744) hybrid systems was lower compared to stand-alone either solar PV ($78,543) or wind ($85,450) systems. Furthermore, the LPSP value is solar PV–wind system (0.0199), stand-alone solar PV (0.02), and stand-alone wind (0.02). Thus, suggesting that the solar PV–wind hybrid system was the cheapest and most reliable. Alternatively, HOMER estimated the cost at $58,027 which was higher than the GA.

The loss of power supply probability (LPSP) was used to evaluate the reliability of each hybrid system. Reliability is the probability of energy supply failure at a certain hour owing to a decrease in renewable output or unintended technical problems. Thus, a lower LPSP value guarantees a greater possibility of fulfilling load demand. LPSP values vary between 0 and 1. For instance, in Scenario 2, a high-reliability index was obtained which is attributed to the abundant solar energy. This notwithstanding, the economic indicators of the PV–wind–biomass system show a better prospect compared with Scenario 1.

Scenario 3 had the least LPSP value (0.00021) suggesting a high likelihood of continuous power supply all year round for the entire system lifespan. However, the analysis reveals that Scenario 3 and Scenario 1 have high proportions of battery storage systems that eventually increase the economic cost. On the other hand, Scenario 2 resulted in very high numbers of PV panels and wind turbines in the absence of a battery storage system. There was comparatively higher initial capital than all other scenarios. The experiment results in Scenario 2 suggest that biomass gasifiers run fewer hours to only meet load demand at peak hours.

Similar studies on energy optimization by Kaabeche et al. (2017) hybridized solar PV–wind with a storage system and applied firefly algorithm (FA) for size optimization. The load dissatisfaction rate and electricity cost are the reliability constraints for the hybrid system. The findings suggest that FA was effective in solving the hybrid system design as compared with accelerated particle swarm optimization (APSO) algorithm, generalized evolutionary walk algorithm (GEWA), and bat algorithm (BA). Again, their outcome suggests that power consumers can tolerate load shedding when hybrid solar PV–wind battery is undersized and cheaper in terms of electricity cost. Further, the sizing of their hybrid system provided 99% and 100% electrical requirements for the users. Unfortunately, Kaabeche, Diaf, and Ibtiouen focused on solar PV–wind and storage which is different from the scenarios considered in our experiment.

Torres-Madroñero et al. (2020) hybridized solar PV–wind and storage and applied genetic algorithm (GA) and PSO to optimize the hybrid system. The LPSP and levelized cost of energy (LCOE) are applied as the objective function. The findings suggest that PSO achieves the best technical or economic indicators, depending on the objective function used and the design criteria; however, the GA is suitable to find outlier solutions that meet the reliability and cost values.

By using wind/PV/biomass/battery hybrid systems, we can get the following importance over using independent sources.

  1. 1.

    Continuously, the daily output of the system is stable since the energy sources may offset the variations in output mutually. The overall system will be generating power during the day and night since wind power is not limited by sunlight even though the amount varies. Of course, production will be higher during the day, but it does not drop to zero at night. Thus, when wind and solar PV fail, then biomass could serve as a power retention unit to augment the power supply.

  2. 2.

    Solar PV systems are more productive during the summer while wind turbines are more productive during the winter, hence every year, the seasonal variations in production are balanced.

  3. 3.

    In the case that there is the need for a battery bank in an off-grid mode, the energy storage size could be reduced to the barest minimum to cut down replacement costs by making one of the main sources operates during the day and the other at night. This phenomenon could ensure that batteries are also subjected to a less aggressive charge/discharge cycle, thus increasing their service life.

  4. 4.

    For wind–PV–biomass hybrid renewable energy systems, the biomass generator serving as power retention can also be sized smaller, because there is less uncertainty concerning the combined wind and solar energy supply.

The SSP algorithm was found to have minimum computational complexity, whereas PSO has the highest. This high complexity of PSO hinders its use in power resource constraint applications while its slow convergence speed makes it unsuitable for time critical applications (Ayodele and Ogunjuyigbe 2016).

9 Conclusion

This paper presented a nature-inspired optimization approach to determining the economic and reliability criteria of different hybrid renewable energy systems. The objective is to determine the cost and reliability of hybridizing varying renewable energy systems to find the most optimal configuration. The finding suggests that SSP finds a near-optimal hybrid system dimension that can supply reliable power for the attached load in each scenario. However, Scenario 4 (solar PV–wind–biomass–battery) hybrid system was the cheapest and most reliable, requiring a relatively low number for solar PV, wind turbines, and biomass gasifiers. The optimal sizing solution for Scenario 4 is solar PV panels (42), each PV panel rated at 1 kW, wind turbine (1) also rated at 1 kW, biomass gasifier (1 kW), and specified batteries (201 units). This means that the optimal hybrid system can ideally generate 44 kW of electrical power from renewable resources when all components participate in the generation of electricity. The reliability index is also estimated at 0.0142, giving a 98.58% assurance of powering the connected load over one year. This level of reliability is achieved with high penetration of battery storage systems. The outcome of this current study is relevant to South Africa’s Renewable Energy Independent Power Producers Procurement Programme (REIPPPP) as it recommends the ideal configuration to meet load demand at a much cheaper cost that is also reliable. The practical implication is that energy practitioners can adopt the SSP algorithm as it produce an optimal design for HRES systems. Future work can focus on utilizing emerging IoT technologies to capture real-time environmental data, such as wind and solar, to inform on the best renewable energy mix in remote locations in Africa and other parts of the world that faces a challenge in energy generation and distribution (Fig. 31).

Fig. 31
figure 31

Pairwise comparison of algorithm showing the sample average rank and significance