Introduction

The Micro-grid (MG) can be defined as a small power system that involves different distributed generators (DGs) and energy storage units for providing energy to a certain load like a microturbine, PVs, WTs, small hydro units, diesel, biomass generation systems as well as batteries, super capacitors, Compressed air energy storage, and flywheels1,2. The MGs can be classified according to their connection with the main electric system to the on-grid MGs and the off-grid or isolated MGs3. In the on-grid MGs, the DGs and the distribution networks are used to provide the energy to the load concurrently while in the isolated type, the load delivers the energy from the DGs only which means that the MGs operate independently4,5. Also, the MGs can be classified according to the power system to AC and DC MGs. Furthermore, the AC MGs are divided into two types, single-phase MG and three-phase MGs.

The optimal operation and energy management of the MG has a great attention for a set of reasons including reducing the operation and production energy costs, ensuring the reliable and stable operation state of the MGs, reducing the dependency on fossil fuel-based DGs, and attaining the most sustainable and eco-friendly operation by maximizing utilization of renewable energy (RE) systems. Thus, numerous optimization methods were proposed for the EM solution of the on-grid or off-grid MGs. In6, a hierarchical Genetic Algorithm (GA) was presented for the EM solution of a grid-connected MG involving PV/WT/Batteries for profit maximization with demand side response.

The Homer software and the particle swarm optimization were implemented to solve the EM of an isolated MG which consists of PV/diesel/WT/batteries for minimizing total net present cost (TNPC) while considering demand side response (DSR) and different battery technologies7. The EM of a DC microgrid consisting of PV and batteries was solved using a modified differential evolution (MDE) to alleviate the operation cost while considering the aging of batteries8. The Improved Walrus Optimization Algorithm (I-WaOA) was presented based on Cauchy mutation and the distance fitness balance for the EM of the IEEE 118-bus distribution system (DS) to reduce the all-over costs and system performance enhancement under the DSR and uncertainties of the system9. Hachemi et al. solved the EM of the 112‐bus Algerian real DS with the optimal installation of PV and WT-based DGs considering four uncertain parameters using the Modified reptile search algorithm for the cost and the performance system improvement10. A modified Capuchin Search Algorithm (MCapSA) was developed based on three modifications for the EM solution of the IEEE 33-bus and 69-bus DSs for multi-objective function including the all-over cost, the voltage deviations (VDs) reduction and under the load-power uncertainty11. Khunkitti et al. presented a significant study using the Marine Predators Algorithm (MaMPA) as an effective algorithm to solve the EM problem for many objective functions including the total cost, transmission losses, emissions, and the voltage stability index of the IEEE 30- and 118-bus systems12. The Prairie Dog Optimization Algorithm (PDO) has been formulated by AE Ezugwu el al. as an efficient algorithm where its experimental results proved its efficiency when compared with other algorithms with a good balance of exploitation and exploration in solving the EM problem13. In14, the authors presented a comprehensive review of applications for the Artificial Hummingbird Algorithm (AHA) for different optimization problems like energy management, image processing, optimal control, and engineering design applications. Krill herd optimization and the ant lion optimizer were employed to solve the EM of an MG consisting of PV/batteries /fuel cell (FC)/WT to reduce the cost15. The artificial hummingbird algorithm was utilized for the inclusion of PVs and WTs on the IEEE 33-bus network for reducing emissions, costs, VDs, and VS enhancement16. Shadman Abid et al. has been utilized for EM of DSs including IEEE 33-bus and 69-bus for multi-objective functions losses, voltage stability margin, economic savings, and VDs17. The EM of EEE 33-bus and 69-bus was solved with the integration of PVs, virtual synchronous generators, and WTs for alleviating the frequency deviation and maximizing energy saving using multi-objective PSO (MOPSO)18. The Equilibrium Optimizer was suggested for solving the EM for a 12-bus small DS for a multi-objective function involving the total cost, VD, and VS in the presence of the WTs and PVs under PV/WT/Load powers uncertainty19.

Recently, the new policy of the electric sectors has been to split the large-scale grids into small multi-micro grids to maximize the use of the DGs to ensure flexible operation and provide a simple and decentralized control ability20,21. The EM was solved for MMGs using a two-level framework based on reinforcement learning taking into consideration the time-varying of the generated power by PV panels and the load demand22.

Recently, the electric sectors have been prone to split large-scale grids into small multi-micro grids to maximize the use of the DGs to ensure flexible operation and provide a simple and decentralized control ability20,21. The EM of an MMG was solved using an improved sparrow search algorithm for cost and emissions reductions23. In24, a 33-bus DS was divided into three MMGs, and the EM was solved to diminish the total cost with DSR using the game theory. The EM of isolated MMG was solved using mixed integer linear programming with DSR and the uncertainties of the system were presented using the scenario-based method25. The authors in26 solved the EM of an MMG as a stochastic bi-level problem with the integration of multiple energy sources for reducing the total costs considering the uncertainties of the system.

Recently, the utilization of biomass energy sources has wildly increased as a renewable and sustainable energy source27. The authors in28 discussed the evolution of using biomass as a renewable energy resource during the eighteenth and nineteenth centuries. Thus, the biomass-based DGs are wildly allocated in the distribution and the MGs along with other sources29,30,31,32,33,34,35. Table 1 summarizes the recent papers on the EM solution.

Table 1 Methods of the EM solution.

The JSO optimizer was utilized for addressing several optimization techniques. However, it suffers from stagnation in the case of solving the high non-convex equations. An enhanced version of JSO was proposed for tackling this issue. The first modification is the FDB36 which was implemented to different optimization techniques like the artificial rabbits optimization algorithm37, the Lévy flight distribution algorithm38, An adaptive gaining-sharing knowledge algorithm39, the Artificial Hummingbird Algorithm40, reptile search algorithm 10. Additionally, the second modification strategy is based on Weibull Flight Motion (WFM) which was implemented to improve the exploration strategy of optimization methods41.

The vital importance of this work is that solving the energy management of multi-microgrids with optimal integration of renewable energy sources can decrease the dependence of using conventional sources as well as enhance the performance of the system.

This paper can fill the research gap where EJSO is implemented for EM of MMGs with the integration of PV, biomass, and WTs simultaneously under uncertainties of the loading and the output powers of the renewable energy resources (RERs) for both economic and technical objective functions. However, the novelties and the contributions can be depicted as follows:

  • The energy management of a multi of multi-microgrids of the 85-bus system is solved with optimal integration of a hybrid system including PV, WT, and biomass units.

  • The uncertainties of the system such as wind speed, load power, and solar irradiance are considered in the energy management solution.

  • Proposing A novel enhanced Jellyfish Search Optimizer (EJSO) for solving the EM based on (WFM) and (FDB) to tackle the stagnation problem of the conventional JSO technique.

The searching ability of the suggested EJSO is demonstrated using CEC -2019 and the traditional benchmark functions. In addition,a comprehensive comparison with SCSO, DO, GWO, the standard JSO, and WOA are achieved.

The remaining sections are listed as follows: "Problem formulation" section gives a deep clarification about the objective functions and the related constraints. "Uncertainty modeling" section describes the method of representing the uncertainties in the system. "Jellyfish search optimizer (JSO)" and "The enhanced jellyfish search optimizer (EJSO)" sections give the description and mathematical equations of JSO and the EJSO, respectively. The discussion of the yielded results is depicted in "Simulation results" section while the summarization of the conclusions is outlined in the final section.

Problem formulation

Objective functions

The cost reduction

The first function considered is the total cost (\(TC\)), which involves the cost of the energy supplied from the main grid (\({C}_{1}\)), the energy loss cost (\({C}_{2}\)), the PV cost (\({C}_{3}\)), the WT unit cost (\({C}_{4}\)), the biomass cost (\({C}_{5}\)) and, the \(TC\) can be expressed as follows:

$$TC={C}_{1}{+{C}_{2}+C}_{3}+{C}_{4}+{C}_{5},$$
(1)

In which

$${C}_{1}= 365\times {U}_{Gr}\times \sum_{h=1}^{24}{P}_{Gr}(h),$$
(2)

where \({P}_{Gr}\), and \({U}_{Gr}\) are the delivered power from the grid and the cost of this power per kW, respectively.

$${C}_{2}=365\times {U}_{L}\times \sum_{h=1}^{24}{P}_{T\_L}(h),$$
(3)

where \({P}_{T\_L}\) and \({U}_{L}\) are the power loss and its cost per kW, respectively.

$${C}_{3}= {C}_{PV}^{inv.}+{C}_{PV}^{O\&M},$$
(4)

where \({C}_{PV}^{inv.}\) denotes the investment cost of the PV panels, \({C}_{PV}^{O\&M}\) is its operation and maintenance cost.

$${C}_{PV}^{O\&M}={U}_{PV}^{O\&M}\times \sum_{h=1}^{24}{P}_{PV}(h),$$
(5)
$${C}_{PV}^{inv.}={CF\times {U}_{PV}\times P}_{r\_PV}$$
(6)

where \({U}_{PV}^{O\&M}\), \({U}_{PV}\), \({P}_{PV}\), \({P}_{r\_PV}\) refer to operation and maintenance cost, i.e., $/kWh, the investment cost, i.e., $/kW, the output and rated powers of the PV panels, respectively. \(CF\) is the capital recovery factor. The WT’s cost can be expressed using (7).

$${C}_{4}= {C}_{WT}^{inv.}+{C}_{WT}^{O\&M},$$
(7)

where \({C}_{WT}^{inv.}\) denotes the investment cost of the PV panels, \({C}_{PV}^{O\&M}\) is its operation and maintenance cost.

$${C}_{WT}^{O\&M}={U}_{WT}^{O\&M}\times \sum_{h=1}^{24}{P}_{WT}(h),$$
(8)
$${C}_{W}^{inst.}={CF\times {E}_{WT}\times P}_{r\_WT},$$
(9)

where \({U}_{WT}^{O\&M}\), \({U}_{WT}\), \({P}_{WT}\), \({P}_{r\_WT}\) refer to the operation and maintenance cost of the WT in $/kWh, the investment cost in $/kW, and the output and rated powers of the PV panels, respectively.

The cost of the biomass system can be calculated as follows:

$${C}_{PV}^{O\&M}={U}_{PV}^{O\&M}\times \sum_{h=1}^{24}{P}_{PV}(h),$$
(10)
$${C}_{PV}^{inv.}={CF\times {U}_{PV}\times P}_{r\_PV}$$
(11)

where \({U}_{PV}^{O\&M}\), \({U}_{PV}\), \({P}_{PV}\), \({P}_{r\_PV}\) refer to operation and maintenance cost, i.e., $/kWh, the investment cost, i.e., $/kW, the output and rated powers of the PV panels, respectively. \(CF\) is the capital recovery factor. The WT’s cost can be expressed using (7).

$${C}_{4}= {C}_{WT}^{inv.}+{C}_{WT}^{O\&M},$$
(12)

where \({C}_{WT}^{inv.}\) denotes the investment cost of the PV panels, \({C}_{PV}^{O\&M}\) is its operation and maintenance cost.

$${C}_{WT}^{O\&M}={U}_{WT}^{O\&M}\times \sum_{h=1}^{24}{P}_{WT}(h),$$
(13)
$${C}_{W}^{inst.}={CF\times {U}_{WT}\times P}_{r\_WT},$$
(14)

where \({U}_{WT}^{O\&M}\), \({U}_{WT}\), \({P}_{WT}\), \({P}_{r\_WT}\) refer to the operation and maintenance cost of the WT in $/kWh, the investment cost in $/kW, and the output and rated powers of the WT, respectively.

The cost of the biomass system cost can be expressed using (15).

$${C}_{4}= {C}_{bio}^{inv.}+{C}_{bio}^{O\&M},$$
(15)

where \({C}_{bio}^{inv.}\) denotes the investment cost of the PV panels, \({C}_{bio}^{O\&M}\) is its operation and maintenance cost.

$${C}_{bio}^{O\&M}={U}_{bio}^{O\&M}\times \sum_{h=1}^{24}{P}_{bio}(h),$$
(16)
$${C}_{W}^{inst.}={CF\times {U}_{bio}\times P}_{r\_bio},$$
(17)

where \({U}_{bio}^{O\&M}\), \({U}_{bio}\), \({P}_{bio}\), \({P}_{r\_bio}\) refer to the operation and maintenance cost of the biomass system in \(\$/\text{kWh}\), the investment cost in $/kW, and the output and rated powers of the biomass system, respectively. The recovery factor can be obtained using (18).

$$CF=\frac{{\beta }_{PV,WT,bio}\times {(1+{\beta }_{PV,WT,bio})}^{{NP}_{PV,WT,bio}}}{{(1+{\beta }_{PV,WT,bio})}^{{NP}_{PV,WT,bio}}-1},$$
(18)

\(NP\) is the lifetime of the generation unit. \(\beta\) is the interest rate.

The yielded power from the PV panels is formulated using (19)42:

$${P}_{PV}\left(ir\right) =\left\{\begin{array}{ll}{P}_{r\_ PV} \left(\frac{{ir}^{2}}{{{ir}^{2}}_{std }\times {X}_{s} }\right) & \quad for \; 0<{ir}^{2}\le {X}_{sp}\\ { P}_{r\_ PV}\left(\frac{ir}{{ir}_{std}}\right) & \quad for \; {X}_{s}\le {ir}^{2}\le {ir}_{std}\\ { P}_{r\_ PV} & \quad {ir}_{std} \le {ir}^{2} \end{array}\right.$$
(19)

where \({ir}_{std}\) and \(ir\) denote solar irradiance and the standard deviations which equals 1000 W/m2.

The WT's output power can be computed as follows43:

$${P}_{W}\left(W\right)=\left\{\begin{array}{lll}0& for& W<{W}_{cin} \; and \; W > {W}_{o}\\ {P}_{r\_w}\left(\frac{W-{W}_{cin}}{{W}_{rs}-{W}_{cin}}\right)& for&\left({W}_{cin}\le W\le {W}_{rs}\right)\\ {P}_{rated\_wind}&for & \left({W}_{rs} < W\le {W}_{cout}\right)\end{array}\right.$$
(20)

where, \({W}_{cout}\), \({W}_{cin}\) and \({W}_{rs}\) represent the cut-out, cut-in, and rated wind speed respectively.

Voltage profile enhancement

Minimizing the voltage deviations will improve the performance of the system. The voltage deviation can be expressed as follows:

$$\sum VD=\sum_{k=1}^{24}\sum_{n=1}^{Nb}\left|\left({V}_{n}-1\right)\right|$$
(21)

where \(Nb\) refers to the number of buses in the MMGs.

Voltage stabilization improvement

Maximization of the voltage stability index (VSI) can improve the system performance43:

$${VSI}_{n}={\left|{V}_{n}\right|}^{4}-4{\left({P}_{n}{X}_{n}-{Q}_{n}{R}_{n}\right)}^{2}-4\left({P}_{n}{X}_{n}+{Q}_{n}{R}_{n}\right){\left|{V}_{n}\right|}^{2},$$
(22)
$$\sum VSI=\sum_{h=1}^{24}\sum_{n=1}^{NB}{VSI}_{n},$$
(23)

where \({X}_{n}\) and \({R}_{n}\) represent the reactance and the resistance of the n-th line, respectively. \({P}_{n}\) and \({Q}_{n}\) are the injected real and reactive powers, respectively.

The previous objective functions can be taken into consideration concurrently as depicted in (24).

$${f}_{t}= {a}_{1}\times {fun}_{1}+ {a}_{2}\times {fun}_{2}+{a}_{3}\times {fun}_{3},$$
(24)
$${fun}_{1}=\frac{{Co}_{Rs}}{{Co}_{Base}},$$
(25)
$${fun}_{2}=\frac{{\sum VD}_{Rs}}{{\sum VD}_{Base}},$$
(26)
$${fun}_{3}=\frac{1}{{\sum VSI}_{Rs}}.$$
(27)

\(Rs\) and \(Base\) are subscripts that refer to the system with and without PVs and WTs, respectively. \({a}_{1},\) \({a}_{2}\) and \({a}_{3}\) are parameters that were selected to be 0.5, 0.25, and 0.25, respectively44.

The constraints

Inequality constraints

$${V}_{Min}\le {V}_{i}\le {V}_{Max},$$
(28)
$${P}_{PV\_r}+{P}_{win{d}_{\_r} }{+P}_{bio\_r}\le \sum_{i=1}^{NB}{P}_{Load,i},$$
(29)
$${PF}_{Min\_w}\le PF\le {PF}_{Max\_w},$$
(30)
$${PF}_{Min\_bio}\le PF\le {PF}_{Max\_bio},$$
(31)
$${I}_{n}\le {I}_{max,n} n =\text{ 1,2},3\dots ,NT,$$
(32)

where the upper and the lower limits for the voltage are \({V}_{min}\), and \({V}_{max},\) respectively, while. \({P}_{Load}\) and \({\text{Q}}_{\text{Load}}\) denote the real and reactive power for the load respectively. \({I}_{max,n}\text{ is}\) the maximum limit of the current at the n-th line. \({PF}_{Min\_w}\) and \({PF}_{Max\_w}\) refer to the minimum and the maximum boundaries for the power factors for the WT, while \({PF}_{Min\_bio}\) and \({PF}_{Max\_bio}\) are the upper and lower limitations for the biomass power factor. \(NT\) is the number of the TLs.

Equality constraints

$${P}_{S}+{P}_{PV}+{P}_{Wind}+ {P}_{bio} = \sum_{i=1}^{NT}{P}_{Losses,i}+\sum_{i=1}^{NB}{P}_{Load,i},$$
(33)
$${Q}_{S}+{Q}_{Wind}+{Q}_{bio} = \sum_{i=1}^{NT}{Q}_{Losses,i}+\sum_{i=1}^{NB}{Q}_{Load,i},$$
(34)

where, \({P}_{S},{P}_{PV},{P}_{Wind}\text{ and }{P}_{bio}\) are the purchased powers of the utility network, the PV units, the units WTs, and the biomass, respectively. \({Q}_{S}, {Q}_{Wind}\text{ and }{Q}_{bio}\) are the reactive powers for the main substation, the WTs, and the biomass units respectively.

Uncertainty modeling

In this work, energy management is solved by taking into consideration three stochastic parameters. The probability density functions (PDFs) are utilized for the representation uncertainties of these parameters.

The first stochastic parameter is the loading which is varied at each time discrete t and it is represented in terms of the Normal PDF based on the standard deviation (\({\sigma }_{PL}\)) of the load and its average value (\({\mu }_{PL}\)) as follows45,46:

$$f\left({P}_{L}\right)=\frac{1}{\sqrt{2\pi {\sigma }_{PL}}}\text{exp}\left(-\frac{{\left({P}_{L}-{\mu }_{PL}\right)}^{2}}{{2}^{\times }{\sigma }_{PL}^{2}}\right).$$
(35)

The wind speeds in any area vary randomly. Weibull distribution is utilized for describing the random variation of the wind speed. Weibull distribution pdf at time discrimination t is described using two parameters including the shape (\({k}_{t}\)) and the scale (\({c}_{t}\)) factors that are driven by the standard deviation (\({\sigma }_{t}^{v}\)) and average (\({\mu }_{t}^{v}\)) of the wind speed as follows47,48:

$${f}_{t}^{\text{WT}}(v)=\frac{{k}_{t}}{{c}_{t}}{\left(\frac{{v}_{t}}{{c}_{t}}\right)}^{{k}_{t}-1}\text{exp}\left(-{\left(\frac{{v}_{t}}{{c}_{t}}\right)}^{{k}_{t}}\right),$$
(36)

in which

$${k}_{t}={\left(\frac{{\sigma }_{t}^{v}}{{\mu }_{t}^{v}}\right)}^{-1.086},$$
(37)
$${C}_{t}=\frac{{\mu }_{t}^{v}}{\Gamma \left(1+\left(1/{k}_{t}\right)\right)},$$
(38)

The third uncertain parameter is the solar irradiance which is modeled using Beta PDF as depicted in (39). The Beta PDF is described using two parameters including the shape factors (α, β) which can be assigned using the average and the standard deviation of the irradiance (\({\mu }_{S}^{t}\), \({\sigma }_{S}^{t}\))49:

$${f}_{s}^{t}(s)=\frac{\Gamma \left({\alpha }^{t}+{\beta }^{t}\right)}{\Gamma \left({\alpha }^{t}\right)\cdot\Gamma \left({\beta }^{t}\right)}\cdot {\left({s}^{t}\right)}^{{\alpha }^{t}-1}\cdot {\left(1-{s}^{t}\right)}^{{\beta }^{t}-1}\text{for }{\alpha }^{t}>0; {\beta }^{t}>0,$$
(39)
$${\beta }^{t}=\left(1-{\mu }_{S}^{t}\right)\times \left(\frac{{\mu }_{S}^{t}\left(1+{\mu }_{S}^{t}\right)}{{\left({\sigma }_{S}^{t}\right)}^{2}}-1\right),$$
(40)
$${\alpha }^{t}=\frac{{\mu }_{S}^{t}\times {\beta }^{t}}{\left(1-{\mu }_{S}^{t}\right)} .$$
(41)

The means and the standard deviations of the demand, the irradiance, and the wind speed during the day ahead are presented in Figs. 1, 2, and 3, respectively.

Figure 1
figure 1

The average load demands and the corresponding standard deviation.

Figure 2
figure 2

The average wind speed and the corresponding standard deviation.

Figure 3
figure 3

The mean solar irradiance and the corresponding standard deviation.

For each time segment t, The Monte Carlo simulation (MCS) method is employed to obtain 1000 scenarios of the uncertain parameters50. Then the scenario-based reduction (SBR) method is employed to minimize the generated scenarios to 25 scenarios51. Figure 4 shows the 1000 created scenarios by MCS, while Fig. 5 shows the reduced scenarios by the SBR method.

Figure 4
figure 4

The 1000 generated scenarios by MCS of the load demand at 12:00 PM.

Figure 5
figure 5

The reduced scenarios by the SBR method of the load demand at 12:00 PM.

Jellyfish search optimizer (JSO)

Jellyfish live all over the world in the water, at different depths and different degrees of temperature. Where jellyfish have different types, but these types differ in size and shape. The behavior of obtaining food differs between jellyfish, as some types of jellyfish obtain food by hunting prey, and other types bring their food by using their tentacles, while the last types obtain their food through filter feeding as they feed on any food carried by the current. It is noted that Jellyfish are known to be weak swimmer organisms, while their orientation concerning currents is the way to their prosperity. Many factors govern the formation of jellyfish swarms, which are those factors related to available nutrients, oxygen availability, and temperatures. The most important factor of these factors is the ocean currents, which work to collect the swarms of jellyfish. In addition to the fact that jellyfish change their location in a swarm or follow ocean currents, jellyfish use a specific mechanism to set the time. The regulation of switching among these types of movement depends on this mechanism. Here, an optimizer was enhanced based on the attitude of jellyfish in searching for food. The jellyfish optimization technique simulates the active and passive motion of the swarm of the jellyfish and its transition between these movements. The suggested algorithm depends on three ideal principles as follows52:

  1. 1.

    Jellyfish move with the current of an ocean or move within a swarm.

  2. 2.

    Jellyfish move in searching for food in the ocean, where jellyfish are attracted to those sites that have an abundance of food.

  3. 3.

    The food’s quantity is explained according to the place and corresponding to the objective function.

Ocean current

Jellyfish are carried away by ocean currents, where the direction of ocean currents is expressed as (DR). This is done by calculating the average vector between jellyfish location within the ocean and the best location of jellyfish, and this can be illustrated as follows:

$$\begin{aligned} \overline{DR } & =\frac{1}{{n}_{\text{Pop }}}\sum_{i=1}^{{n}_{\text{P }}}{\text{DR}}_{i}=\frac{1}{{n}_{\text{P }}}\sum_{i=1}^{{n}_{\text{Pop }}}\left({X}_{b}-{e}_{c}{X}_{i}\right)\\ & ={X}_{b}-{e}_{c}\frac{\sum_{i=1}^{{n}_{\text{P }}}{X}_{i} }{{n}_{\text{P }}}={X}_{b}-{e}_{c}\mu \\ \end{aligned}$$
(42)
$$\text{Set }df={e}_{c}\mu$$
(43)
$$\overline{DR }={X}_{b}-df$$
(44)

where, \({X}_{b}\) represents the optimal position of jellyfish in the swarm, \({n}_{\text{Pop}}\) is the jellyfish number, \({e}_{c}\) denotes the governing attraction factor, \(\upmu\) denotes the mean location for all jellyfish and \(\text{df}\) represents the difference between the mean place and the current optimal place of the jellyfish. Due to the common distribution of all positions, the jellyfish distance \(\pm \beta \sigma\) is the distance around the average site which contains a given certain probability of all jellyfish. Hence, \(\text{df}\) can be expressed as:

$$df=\beta \times \mu \times \varepsilon$$
(45)

By substitution of \(df\) from (41) into (40). \(\varepsilon\) denotes a variable that is generated randomly from where \({\varvec{\upvarepsilon}}\) ~ Bernoulli(p), with p = 1/2.

$$\overline{DR }={X}_{b}-\beta \times \mu \times \varepsilon$$
(46)

Based on the foregoing, the new position of the jellyfish can be illustrated as follows:

$${X}_{i}(t+1)={X}_{i}(t)+\varepsilon \times \overline{DR }$$
(47)

By substituting of \(\overline{DR }\) from (45) in (47).

$${X}_{i}(t+1)={X}_{i}(t)+\varepsilon \times \left({X}_{b}-\beta \times \mu \times rand\right)$$
(48)

The Jellyfish swarm

Two kinds of motions govern the movement of jellyfish in the group. The two kinds of these movements can be described as follows:

Motion A is the passive movement, and the second type B is the active movement. Jellyfish begin to transfer according to the first type (A), and over time, Jellyfish follow the second type of movement (B). The jellyfish move its position can be presented as follows:

$${X}_{i}^{t+1}={X}_{i}^{t}+\gamma \times \varepsilon \times \left({U}_{up}-{L}_{low}\right)$$
(49)

where \({U}_{up}\) and \({L}_{low}\) denote the upper boundary and lower boundary of the variables, respectively. \(\gamma >0\) refers to the movement factor.

To characterize B movement, two jellyfish (j, i) have been chosen where j ≠ i. Where the movement of jellyfish can be described according to the availability of the amount of food. When the available food is high for j-th jellyfish more than that for i-th jellyfish, this jellyfish moves towards j-th jellyfish. The opposite happens if the amount of food is little, the jellyfish (i) shifts away from the j-th jellyfish. Based on the above, this movement can be described as follows:

$$\overline{ST }={X}_{i}^{t+1}- {X}_{i}$$
(50)

where,\(\overline{ST }\) denotes the distance and can be expressed as follows:

$$\overline{ST }=rand\times \overline {{\text{Direction}}}$$
(51)
$${X}_{i}^{t+1}={X}_{i}^{t}+\overline{ST }$$
(52)
$$\overline {{\text{Ei}}}=\left\{\begin{array}{ll}{X}_{j}(t)-{X}_{i}(t) & \quad if \; f\left({X}_{i}\right)\ge f\left({X}_{j}\right)\\ {X}_{i}(t)-{X}_{j}(t)& \quad if \; f\left({X}_{i}\right)<f\left({X}_{j}\right)\end{array}\right.$$
(53)

where, \(\overline {{\text{Ei}}}\) is the direction of jellyfish motion.

Note that the mechanism of the controlled time is used to explain the kind of movement all over time. As it is not only controlling the motions of A and B within the swarm, but also controlling the motions of jellyfish towards the ocean currents, and this is what will be presented in the next section.

Mechanism of time control

The transition motion of jellyfish between all types of motions (type A, type B, ocean current) can be explained by the function of time control as expressed in (54).

$$cont(t)=\left|\left(1-\frac{t}{{it}_{max}}\right)\times (2\times \varepsilon -1)\right|$$
(54)

where \(cont\) represents the time control function and it fluctuates from 0 to 1 which compared with a constant value \({C}_{0}\) where, \({C}_{0}=0.5\). \({it}_{max}\) refers to the maximum number of iterations. In case the value of the \(count(t)\) is more than \({C}_{0}\), jellyfish move with the ocean current. It is worth noting here that, the jellyfish populations are randomly generated based on a stochastic and logistic map to enhance the initial population diversity and this can be explained as follows:

$${\xi }^{{{\prime}}}=\mu \zeta (1-\xi )$$
(55)
$${X}_{i}(t+1)={X}_{i}(t)+{\xi }^{{{\prime}}}\times \left({U}_{b}-{L}_{b}\right)$$
(56)

where \(\xi\) denotes a stochastic value that is generated at the start of the iteration in the range [0–1]. \(\mu\) has a fixed value where its value equals 4 and \({\xi }^{{{\prime}}}\) is a stochastic and a logistic value where \({\xi }^{{{\prime}}}\ne \left\{0.0, 0.25, 0.75, 0.5, 1.0\right\}\).

The enhanced jellyfish search optimizer (EJSO)

The EJSO depends upon two improvement approaches including the WFM and the FDB to boost the searching capability of the presented algorithm. The WFM is conceptualized from Weibull Distribution which is based on the scale and the shape factors as explained before53. The motion of the jellyfish based on the Weibull flight can be described as follows:

$${{\varvec{x}}}_{\text{new,i }}={{\varvec{x}}}_{\text{new,i }}+\text{St}$$
(57)

in which

$$\text{St= rb (1,1,[1,}D])\cdot \times \text{sign}(\text{rand}(1,D)-0.5),$$
(58)

where \({\varvec{r}}{\varvec{b}}\text{ refers}\) to a variable that is randomly obtained from the Weibull distribution. Sign () generates a vector of –1 and + 1. The second strategy is the FDB selection method which was applied to improve several36,54,55,56,57. The FDB is utilized for enriching the population’s diversity. The FDB is determined by the distance between the best population and the candidates’ solution. Initially, the candidate populations and the corresponding objective functions vector are represented using Eqs. (59) and (60).

$$P\equiv {\left[\begin{array}{ccc}{x}_{11}& \cdots & {x}_{1n}\\ \vdots & \ddots & \vdots \\ {x}_{m1}& \cdots & {x}_{mn}\end{array}\right]}_{mxn},$$
(59)
$$F\equiv {\left[\begin{array}{c}{f}_{1}\\ \vdots \\ {f}_{m}\end{array}\right]}_{mx1},$$
(60)

The distance between the best population and the candidate populations is calculated as follows:

$${D}_{{P}_{i}}=\sqrt{{\left({x}_{1[i]}-{x}_{1[\text{ best }]}\right)}^{2}+{\left({x}_{2]i]}-{x}_{2[\text{best }]}\right)}^{2}+\cdots +{\left({x}_{n[i]}-{x}_{n[\text{best }]}\right)}^{2}},$$
(61)

The fitness distance vector

$$DP\equiv {\left[\begin{array}{c}{d}_{1}\\ \vdots \\ {d}_{m}\end{array}\right]}_{mx1}$$
(62)

The populations’ scores in the FDB are calculated based on the normalized distance and the normalized objective function as follows:

$${S}_{{P}_{i}}=w\times norm{F}_{i}+(1-w)\times \text{norm}{DP}_{i}$$
(63)

where \(w\) represents a weight parameter in the range 0 and 1. The flow chart of the proposed algorithm is shown in Fig. 6. It should be highlighted here that the objective function is calculated after updating the position of the population to assign the best solution and keep the best-updated population because the FDB strategy is based on the distance between the population and the best solution. Thus, it is mandatory to assign the best solution after updating the populations. The pseudocode of the proposed optimizer can be described in Algorithm 1

Algorithm 1
figure a

The pseudocode of EJSO.

.

Figure 6
figure 6

The schematic flow chart of the EJSO.

Simulation results

The suggested EJSO is employed for the EM solution of the MMGs. The obtained results have been compared to well-known other optimizers the grey wolf optimizer GWO58, whale optimization algorithm (WOA)59, sand cat search optimizer (SCSO)60, dandelion optimizer (DO)61 and Jellyfish search optimizer (JSO)52. The EJSO was written by the MATLAB software and the simulations were conducted on a PC with Intel i5, 4 GB RAM, 2.5 GHz CPU.

Solving of the standard and CEC-2019 benchmark functions

In this section, the suggested EJSO has been applied to the 33 benchmark functions in which F1 to F 23 are the standard functions while CEC 01 to CEC10 are the CEC 2019 functions. The parameters of optimization methods are provided in Table 2. The standard functions including the unimodal, multimodal, and fixed-dimension benchmark functions have been described in Tables 3, 4 and 511,62,63, respectively while the description of CEC 2019 functions have been depicted in Table 664. The results were presented over 25 run trails.

Table 2 The parameters of the optimization methods.
Table 3 Unimodal functions.
Table 4 Multimodal functions.
Table 5 Fixed dimension functions.
Table 6 The CEC 2019 functions.

Analysis of the statistical results

Here, the performance of EJSO has been compared with GWO, DO, WOA, SCSO, and the standard JSO in terms of the worst, the best, the mean, the Wilcoxon p-values, and the standard deviation (SD) values as depicted in Table 7 for the standard and the CEC-2019 functions. The bolded values in this table refer to the best statistical results. As per the results of Table 7, the proposed EJSO algorithm has superior results in the most objective functions. However, the results are similar with SCSO for F11, JSO for F14, all optimizers for F16, all optimizers except WOA for F17, DO and JSO for CEC02, and all optimizers for CEC03. Furthermore, some optimizers give results better than the EJSO like SCSO for F10 and DO for CEC01, DO for CEC10. According to the Wilcoxon test, the p-values are less than 0.05 which verified there is a notable difference between the obtained results from the suggested algorithm and the other optimization methods. The p-values for F9, F11, and F17 are not available, this means that the results are identical for all trail runs. The computational time for SCSO, GWO, WOA, DO, JSO, and EJSO algorithms are 61.4, 91.2, 150.8, 208.6, 368.3 and 1780.6 respectively. It should be highlighted here that the computational time of the proposed algorithm EJSO is slightly more than the original algorithm, this is due to the added modifications to the original algorithm. However, the EJSO needs more time, but the accuracy of the obtained results is the best.

Table 7 The statistical outcomes of the standard and CEC 2019 functions.

The convergence analysis

The convergence characteristics of the proposed EJSO, GWO, DO, WOA, SCSO, and the standard JSO are illustrated in Fig. 7. It is evident from the convergence characteristics, that the EJSO has good convergence for the unimodal, the multimodal, the fixed-dimension, and the CEC-2019 functions. However, the convergence of the DO is the best for CEC10.

Figure 7
figure 7figure 7figure 7

The convergence of benchmark functions by different optimizers.

The analysis of the boxplot

Boxplot is the best way to display the distribution of the data. The boxplots of the EJSO and the other optimizers are shown in Fig. 8. According to the boxplots, EJSO has the narrowest boxplot compared to the other optimizers for the standard and the CEC 2019 functions compared to GWO, DO, WOA, SCSO, and the standard JSO.

Figure 8
figure 8figure 8figure 8

The boxplot of different optimizers.

Application of the EJSO for EM solution

In this section, the suggested algorithm EJSO has been modified and applied in IEEE 85–bus which is divided into three micro-grids. The description of the IEEE 85-bus is listed in Table 8. The topology of IEEE 85-bus MMGs is depicted in Fig. 9 and lines and bus data are provided in60. The studied distribution network has been divided into three microgrids and due to this division, every microgrid contains its RERs (PV, WT, and Biomass) where each network has one PV unit, one WT, and one biomass unit. The captured results by EJSO have been compared with the obtained results by the conventional JSO. For a fair comparison, the populations and the maximum iterations number have been adjusted to be 25 and 80, respectively. The purchasing energy price of the market is explained in Fig. 10 while the day ahead of the loading demand is illustrated in Fig. 1165. Figures 12 and 13 show the expected irradiance and wind speed respectively66. Three hybrid RERs are incorporated optimally in which each hybrid system consists of a PV plant, a WT, and a biomass generation unit. The system constraints as well as the costs of the PV, WT, and biomass units are listed in Table 9.

Table 8 Descriptions of the IEEE 85-bus MMGs.
Figure 9
figure 9

The topology of the IEEE 85-bus MMGs.

Figure 10
figure 10

The market energy price.

Figure 11
figure 11

The expected load profile.

Figure 12
figure 12

The expected irradiance.

Figure 13
figure 13

The expected wind speeds.

Table 9 The cost parameters and the limitations.

The aim of the EM is total annual cost reduction and the system’s performance improvement. Table 10 lists the numerical results that have been obtained at the base case and with the inclusion of the hybrid PVs, biomass, and WTs using the JSO and the EJSO. The numerical results have been depicted in Table 10 which have been obtained by the JSO and the EJSO for the EM solution with or without RERs. In the base case, the cost, the VDs, and the VSI are 4.1642E+06 USD, 119.7076 p.u. and 1.5844E+03 p.u. respectively while the annual purchased energy and the annual energy losses are 6.4879E+06 kWh and 6.5982e+05 kWh.

Table 10 The results of the energy management solution for the MMGs.

As per the results in Table 10, the total costs have been reduced to 2.3726E+06 p.u. and 2.3008E+0 using the JSO and the EJSO, respectively. Likewise, the summation of VDs has been reduced from 119.7076 p.u. to 70.8672 p.u. and the voltage stability has been enhanced from1.5844E+03 p.u. to 1.7517E+03 p.u. The sites of the three hybrid generation systems that were allocated by JSO are at buses 4, 49, and 69 while the assigned placements by the EJSO are at buses 7, 55, and 68. The optimal ratings of the PV units of the 1st, the 2nd, and the 3rd hybrid systems that have been determined by the EJSO are 157 kW, 151 kW, and 209 kW, respectively. Likewise, the rating of the WTs in the MMGs are 450 kW, 500 kW, and 500 kW, respectively while the rating of the biomass generation systems are 3.6448E+03 kW, 2.3768E+03 kW, and 2.7403E+03 kW, respectively. The output power of PV units has been illustrated in Fig. 14 according to the solar irradiance as well as Fig. 15 illustrates the output power of the WT units which varied due to the wind speed variation. Figure 16 displays the optimal powers of the biomass system. Figure 17, and Fig. 18 show the voltage profile of the MMG without and with RERs, respectively. From Figs. 17 and 18, it is evident that the voltage profile has been enhanced in the presence of RERs in the proposed hybrid system. As per Fig. 19, the losses were significantly decreased with the installation of the RERs into the system.

Figure 14
figure 14

The generated powers from PVs.

Figure 15
figure 15

The generated powers from WTs.

Figure 16
figure 16

The output power of biomass units.

Figure 17
figure 17

The voltage profile without RERs.

Figure 18
figure 18

The voltage profile with RERs.

Figure 19
figure 19

The active losses of the system.

Conclusions

The key findings of this paper can be summarized as follows: firstly, a novel enhanced Jellyfish Search Optimizer (EJSO) was proposed, incorporating Feedback Disturbance Based (FDB) and Weighted Fitness Mechanism (WFM) to address the stagnation issues present in the conventional Jellyfish Search Optimizer (JSO). This enhancement aims to improve the optimization performance and convergence speed of the algorithm.

Secondly, the proposed EJSO was employed for the energy management (EM) of multi-microgrids within an 85-bus system. The optimization process took into consideration various critical factors, including the total cost, voltage profile, and overall stability of the system. The optimal allocation strategy within each microgrid included a hybrid system comprising photovoltaic (PV) systems, wind turbines (WT), and biomass units, which together enhance the efficiency and sustainability of the microgrids.

Moreover, the performance of the proposed EJSO was benchmarked against several other optimization algorithms, including the Sine Cosine Search Optimizer (SCSO), the conventional Jellyfish Search Optimizer (JSO), Differential Evolution (DO), and the Whale Optimization Algorithm (WOA), using both standard test functions and the CEC-2019 benchmark suite. The comparative analysis demonstrated the superiority of EJSO in terms of solution quality and robustness.

In practical terms, the application of the proposed EJSO for energy management with the optimal integration of hybrid Renewable Energy Sources (RESs) significantly reduced the total cost from 4.1642E+06 USD to 2.3008E+06 USD compared to the base case. Additionally, the voltage deviation (VD) was lowered from 119.7076 p.u. to 70.8672 p.u., and the voltage stability index was improved from 1.5844E+03 p.u. to 1.7517E+03 p.u. These results indicate substantial improvements in both economic and technical performance of the microgrid system.

Looking forward, future work associated with this research includes expanding the scope of energy management solutions by integrating electric vehicle (EV) stations into distribution systems. Furthermore, it suggests the optimal incorporation of various types of energy storage systems, such as compressed air energy storage (CAES) and superconducting magnetic energy storage (SMES), to further enhance the flexibility and reliability of the energy management systems.