Introduction

Optimization algorithms have played a vital role in recent decades in assisting engineers and designers in finding improved solutions for saving time, money, and energy1. Numerical optimization methods often employ simple and widely used models2. Nevertheless, these algorithms require several gradient information to find superior solutions circling a specific point in a small space3. Furthermore, they are sensitive to starting points, mainly when the issues under consideration include multiple local solutions. Inappropriate initial point selection makes searching for the global optimum solution complex and inconsistent4. In recent years, many complicated optimization problems have evolved in various disciplines. These problems frequently involve several choices of optimization variables, complex nonlinear constraints, and objective functions5. These algorithms have been used for civil engineering6, electrical engineering, image processing7, medical and biological applications, and others.

As a result, existing numerical approaches cannot address these complicated problems promptly and precisely. On the other hand, nature inspiration can provide concepts to develop artificial intelligence algorithms to solve these complex problems.

Recently, various nature-inspired metaheuristic algorithms (MAs) have been developed. These MAs mimic the motions of live beings or natural events. These MAs have been elaborated and employed for solving many optimization issues as competitive alternative solvers8. However, these MAs have a common drawback; they frequently exhibit an extra sensitivity to adjusting user-defined parameters. Another disadvantage is that MAs may not always reach the global optimum solution9. MAs are divided into two types8: single solution-based and population-based. A single solution is processed during optimization in the single solution-based type. In contrast, in the population-based type, solutions are developed in each optimization iteration. Population-based MAs initiate the optimization process by producing a set of random individuals. Each of them represents a possible optimal solution. Iteratively, the population will be developed by substituting the actual population with a recently created one based on certain stochastic operators10,11.

Regardless of how diverse these algorithms are, they always have one common characteristic: the searching operations are divided into two phases: exploration and exploitation12. As a result, during the early stages of the search process, a well-designed optimizer's exploratory behaviors must have an enriched-enough random character to distribute more random solutions effectively13. Hence, it enhanced diverse parts of the search space. After the exploration phase, the exploitation phase is carried out. The optimizer accelerates the search process in a narrow area instead of the whole search space by concentrating on the neighborhood of the best-obtained solutions. An efficient optimizer must strike an acceptable and precise balance between the exploration and exploitation phases. Otherwise, the risk of becoming locked in local optima (local solutions) and having immature convergence downsides grows. According to the No Free Lunc (NFL) theorem [36], all the proposed MAs show a comparable average performance when resolving all possible optimization problems. In other words, no algorithm can be considered a general best algorithm. As a result, the NFL theorem promotes creating and developing more new efficient optimizers. Technically, each MA employs unique evolution mechanisms. According to14, several fundamental concepts can be used to characterize them. Among these concepts:

  • Parallelism is utilized in population-based algorithms such as SA and HA. Different individuals are sent out at once to complete a task, and the results are compared. According to the comparison, additional ideas are utilized to assess the population evolution or to create new individuals.

  • Acceptance is utilized in three cases: 1. Admit temporary solutions that weaken objective function due to search space expansion, 2. Handling the cost function's constraints. There are two ways to cope with the constraints. The first way excludes any solutions if they match the start conditions. The second procedure is used if any solution can be allocated a numerical value. In this case, all solutions must participate, and the initial conditions may match infeasible solutions. 3. Adding restrictions to allowed solutions that improve the optimal solution by, at minimum, the limiting level. When comparing values produced from previous calculations, this strategy aids in avoiding numerical issues.

  • Elitism: the best solution must be kept from one iteration to the next in repeating population-based algorithms. The elitism principle is utilized to accomplish this by retaining the individual who outlined the best solution and utilizing it as a reference for the following iteration or upgrading it if a better solution is located. The notion of elitism may also be applied to many individuals, directing an élite group of them to the next iteration.

  • Selection is a probability-based method that generates new individuals from a pool of available ones. This approach may incorporate weights into the probabilistic selection process, in which random individuals are chosen to produce new ones.

  • Decay or Reinforcement: Decay allows for more initial freedom, followed by incremental flexibility constraints. This approach is based on a decremental updating factor (< 1) used at each iteration. Reinforcement is employed similarly in some cases by applying an incremental factor higher (> 1).

  • Immunity is gained through finding characteristics of solutions that lead to appropriate settings. Immunity prefers solutions with characteristics similar to those attributes.

  • Self-Adaptation is a process that allows the parameters of algorithms to be updated in response to the progress of optimization.

A novel high-efficiency SA optimization algorithm is suggested in this study to compete with existing optimizers. The basic concept of the suggested optimizer is based on the hunting skills of Red-tailed Hawks, one of the most intelligent birds of prey. The benefits of evolutionary and swarm approaches have been included in the RTH algorithm's design to outperform the existing optimization algorithms. The proposed RTH contains three stages: high soaring, low soaring, and stooping and swooping stages. The high soaring stage is quite similar to evolutionary approaches' search behavior. The RTH algorithm relays and gathers all search points, beginning with the original position and progressing to the best position. The second and third phases imitate SA's behavior while moving to the best position, using the information of the preceding site for each point.

Despite the availability of metaheuristic algorithms, there is a continuous need for developing and creating new algorithms that may provide better performance for such problems than the actual ones. The NFL theory confirms this need for new optimizers. To this end, this paper suggests this novel algorithm. The main contribution of this paper is to propose a novel nature-inspired metaheuristic optimization algorithm for better solving optimization issues. The proposed algorithm benefit from the unique hunting strategy of the red-tailed hawk and applies it to tackle various optimization problems. The suggested RTH algorithm's performance has been examined on three optimization problem classes. The first class contains three types of optimization functions:

  • Twenty-three standard benchmark functions: unimodal, multimodal, and fixed-dimensional multimodal functions.

  • IEEE Congress on Evolutionary Computation 2020 (CEC2020) with 15 and 20 search space dimensions.

  • IEEE Congress on Evolutionary Computation 2022 (CEC2022) with 10 and 20 search space dimensions.

The proposed algorithm is compared with eight recent algorithms to confirm its contribution to solving the problems of this class. The considered algorithms in the comparison are Farmland fertility Optimizer (FO)15, African Vultures Optimization Algorithm (AVOA)16, Mountain Gazelle Optimizer (MGO)17, Artificial Gorilla Troops Optimizer (GTO)18, COOT algorithm19, Hunger Games Search (HGS)20, Aquila Optimizer (AO)21, and Harris Hawks optimization (HHO)22. The findings' accuracy (mean value), robustness (standard deviation), and convergence speed are compared. The second class consists of seven real-world engineering problems that will be thoroughly investigated compared to previously published solutions. These problems include the optimal design of an I-shaped beam, a three-bar truss Design, design of a tubular column, a piston lever, a corrugated design, and design tension/compression spring. The third class provides the parameters extraction for proton exchange membrane fuel cell (PEMFC), which will be used to assess the suggested algorithm with a difficult task. To validate its performance, the proposed algorithm will be compared to numerous published articles for three types of PRMFC: BSC 500W, NedStack PS6, and SR-12 500W.

The rest of this paper is organized as follows: Section “Related works” presents a related works part that shows and explains a set of related works. Section “Red-tailed hawk algorithm” reviews the hunting behavior of red-tailed, gives the inspiration source, and describes each stage of the proposed RTH algorithm. This section includes the mathematical model of the proposed algorithm. Section “Results and discussion” presents the outcomes of RTH in solving the considered problems. This paper ends with a conclusion in Section “Engineering optimization problems”.

Related works

In recent decades, there has been a rise in the assessment and application of metaheuristic algorithms to tackle optimization problems. In the literature, the population-based MAs may be divided into four categories based on their inspiration23,24: evolutionary (EA), Physics-based (PA), Human-based (HA), and swarm-based MAs (SA). EAs imitate biological evolutionary processes, including recombination, mutation, and selection. The Genetic Algorithm (GA)25,26, Differential Evolution (DE)27, Biogeography-Based Optimizer (BBO)28, and Mind evolutionary algorithm optimization (MEDA)29 are the most well-known EAs. Physical phenomena-inspired algorithms are based on physical laws such as gravity, magnetic force, etc. Gravitational Search Algorithm (GSA)30, Gradient-based optimizer31, and Energy Valley Optimizer (EVO)32 are a few examples. Human-based MAs imitate some human activities and behaviors. Socio Evolution and Learning Optimization (SELO)33, Social Network Search (SNS)34, and Human Felicity Algorithm (HFA)35 are some examples of this category. Swarm-based MAs mimic the social behaviors of animals or organisms living in swarms, communities, or packs36. Particle Swarm Optimization (PSO)37, Salp Swarm Algorithm (SSA)38, and Jellyfish Search algorithm (JSA)39 are the most well-known MAs in this category. The swarm-based MAs have been getting more attention in the last years due to the availability of inspiration sources and their efficacy in resolving various optimization problems. New papers propose or review this category of optimization algorithms, such as Mountain Gazelle Optimizer (MGO)17, Advances in Spotted Hyena Optimizer40, Advances in Tree Seed Algorithm41, Advances in Sparrow Search Algorithm42, Butterfly Optimization Algorithm (BOA)43, Advanced Butterfly Optimization Algorithm (ABOA)44, Modified Butterfly Optimization Algorithm with Lagrange Interpolation (MBOALI)45, African Vultures Optimization Algorithm (AVOA)16, Whale optimization algorithm (WOA)46, Artificial Gorilla Troops Optimizer (GTO)18, COOT algorithm19, Weibull Flight based Moth Flame Optimization (WF-MFO)47, Hunger Games Search (HGS)20, Aquila Optimizer (AO)21 and so on. On the other hand, Quantum-inspired metaheuristic algorithms developed by combining Quantum Computing (QC) principles into metaheuristic algorithms are gaining more interest48. The performance of these algorithms is considerably enhanced by using the QC for boost exploration and exploitation and faster convergence.

Red-tailed hawk algorithm

This part discusses the proposed RTH algorithm. The inspiration source and hunting strategy are discussed in the first subsection. Then, the mathematical model mimicking the red-tailed hawk's behavior is presented, and each stage of the algorithm is analyzed.

Inspiration and behavior during hunting

The red-tailed hawk (Buteo jamaicensis) is a bird of prey that breeds over much of North America, from Alaska's interior and northern Canada to Panama and the West Indies. The red-tailed hawk lives in various environments and elevations, such as deserts, grasslands, forests, agricultural fields, and cities. The red-tailed hawk is a predatory, carnivorous eater. Almost every little animal they come upon may be seen as possible prey49. Small mammals, such as rodents, are their most common prey, although they also eat birds, fish, reptiles, invertebrates, and amphibians. Prey varies greatly depending on geographical and seasonal availability; however, rodents comprise 85 percent of a hawk's diet50.

The red-tailed hawk soars with its wings in a mild dihedral, flapping as little as possible to save energy. Unlike other hawks, the red-tails can fly for long distances thanks to this feature. Because soaring is the most efficient flying mode for these hawks, it is utilized more frequently51. It moves between 32 and 64 km/h (20–40 mph) when soaring or flapping its wings. The large wings allow the red-tailed to reach 190 km/h (120 mph) when plunging52. Red-tailed hawks can fly fast and powerfully while repeatedly diving at perceived threats during nest protection53. As illustrated in Fig. 1, the red-tailed has three types of flying:

  • High soaring (Fig. 1a): It flies highly with its wings in a mild dihedral, flapping as little as possible to save energy to explore the selected area.

  • Low soaring (Fig. 1b): after selecting the target position, the red-tailed fly with a low soaring in a spiral movement around the prey. This movement allows it to detect the best location and time to hit the target.

  • Stooping and swooping (Fig. 1c): after selecting the best location and moment in the previous step, the red-tailed swooped its prey by stooping and raising its acceleration (from 32–64 to 190 km/h) in a curved direction.

Figure 1
figure 1

Behavior of red-tailed hawk during hunting.

Mathematical model

The suggested red-tailed hawk (RTH) algorithm mimics the red-tailed hawk's hunting behavior. The actions taken at each hunt stage are presented and modeled. This algorithm includes three stages, high soaring, low soaring, and stooping and swooping.

  1. 1

    High soaring: the red-tailed hawk will soar far into the sky, looking for the best location in terms of food availability. Figure 2 illustrates the behavior of the red-tailed hawks during the high soaring stage, and Eq. (1) represents the mathematical model of this stage :

    $$X(t) = X_{best} + (X_{mean} - X(t - 1)) \cdot Levy(\dim ) \cdot TF(t)$$
    (1)

    where X(t) represents the red-tailed hawk position at the iteration t, Xbest is the best-obtained position, Xmean is the positions' mean, Levy represents the levy flight distribution function that can be calculated according to Eq. (2), and TF(t) denotes the transition factor function that can be calculated according to Eq. (3).

    $$\begin{aligned} & Levy(\dim ) = s\frac{\mu \cdot \sigma }{{\left| \upsilon \right|^{{\beta^{ - 1} }} }} \\ & \sigma = \left( {\frac{{\Gamma (1 + \beta ) \cdot \sin \left( {{\raise0.7ex\hbox{${\pi \beta }$} \!\mathord{\left/ {\vphantom {{\pi \beta } 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}}} \right)}}{{\Gamma ({\raise0.7ex\hbox{${1 + \beta }$} \!\mathord{\left/ {\vphantom {{1 + \beta } 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}}) \cdot \beta \cdot 2^{{\left( {{\raise0.7ex\hbox{${1 - \beta }$} \!\mathord{\left/ {\vphantom {{1 - \beta } 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}}} \right)}} }}} \right) \\ \end{aligned}$$
    (2)

    where s is a constant (0.01), dim is the problem dimension, β is a constant (1.5), u, and υ are random numbers [0 to 1].

    $$TF(t) = 1 + \sin \left( {2.5 + \left( {{\raise0.7ex\hbox{$t$} \!\mathord{\left/ {\vphantom {t {T_{\max } }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${T_{\max } }$}}} \right)} \right)$$
    (3)

    where Tmax represents the max number of iterations.

    Figure 2
    figure 2

    Behavior of red-tailed hawk during high soaring stage.

  2. 2

    Low soaring: the hawk surrounds the prey by flying much lower to the ground in a spiral line. This stage is illustrated in Fig. 3, and its model can be expressed as follows:

    $$\begin{aligned} & X(t) = X_{best} + (x(t) + y(t)) \cdot {\text{StepSize}}(t) \\ & {\text{StepSize}}(t) = X(t) - X_{mean} \\ \end{aligned}$$
    (4)

    where x and y denote direction coordinates which can be calculated as follows

    $$\begin{array}{*{20}c} {\left\{ \begin{gathered} x(t) = R(t) \cdot \sin \left( {\theta (t)} \right) \hfill \\ y(t) = R(t) \cdot \cos \left( {\theta (t)} \right) \hfill \\ \end{gathered} \right.} & {\left\{ \begin{gathered} R(t) = R_{0} \cdot \left( {r - {\raise0.7ex\hbox{$t$} \!\mathord{\left/ {\vphantom {t {T_{\max } }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${T_{\max } }$}}} \right) \cdot rand \hfill \\ \theta (t) = A \cdot \left( {1 - {\raise0.7ex\hbox{$t$} \!\mathord{\left/ {\vphantom {t {T_{\max } }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${T_{\max } }$}}} \right) \cdot rand \hfill \\ \end{gathered} \right.} \\ \end{array} \,\,\left\{ \begin{gathered} x(t) = {\raise0.7ex\hbox{${x(t)}$} \!\mathord{\left/ {\vphantom {{x(t)} {\max \left| {x(t)} \right|}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\max \left| {x(t)} \right|}$}} \hfill \\ y(t) = {\raise0.7ex\hbox{${y(t)}$} \!\mathord{\left/ {\vphantom {{y(t)} {\max \left| {y(t)} \right|}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${\max \left| {y(t)} \right|}$}} \hfill \\ \end{gathered} \right.$$
    (5)

    where R0 represents the initial value of the radius [0.5–3], A denotes the angel gain [5–15], rand is a random gain [0–1], and r is a control gain [1, 2]. These parameters help the hawk fly around the prey with spiral movements, as explained in Fig. 4.

    Figure 3
    figure 3

    Behavior of red-tailed hawk during low soaring stage.

    Figure 4
    figure 4

    Evolution of the direction coordinates as a function of iterations.

  3. 3

    Stooping and Swooping: In this stage, the hawk suddenly stoops and attacks the prey from the best-obtained position in the low soaring stage. Figure 2 explains the behavior of the red-tailed hawks during this stage. This stage can be modeled as follows:

    $$X(t) = \alpha (t) \cdot X_{best} + x(t) \cdot {\text{StepSize1}}(t) + y(t) \cdot {\text{StepSize2}}(t)$$
    (6)

    where each step size can be calculated as follows

    $$\begin{aligned} & {\text{StepSize1}}(t) = X(t) - TF(t) \cdot X_{mean} \\ & {\text{StepSize2}}(t) = G(t) \cdot X(t) - TF(t) \cdot X_{best} \\ \end{aligned}$$
    (7)

    where α and G are the acceleration and the gravity factors, respectively, they can be defined as follows:

    $$\begin{aligned} & \alpha (t) = \sin^{2} \left( {2.5 - {\raise0.7ex\hbox{$t$} \!\mathord{\left/ {\vphantom {t {T_{\max } }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${T_{\max } }$}}} \right) \\ & G(t) = 2 \cdot \left( {1 - {\raise0.7ex\hbox{$t$} \!\mathord{\left/ {\vphantom {t {T_{\max } }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${T_{\max } }$}}} \right) \\ \end{aligned}$$
    (8)

    where α represents the hawk's acceleration that increases with the increase of t to enhance the convergence speed, and G is the gravity effect that decreases to reduce the exploitation diversity when the hawk is much near the prey. This phase is explained in Fig. 5.

    Figure 5
    figure 5

    Behavior of red-tailed hawk during stooping and swooping stages.

Figure 6 presents the evolution of the solutions of a 2-dimensional problem as a function of the iterations. During the first iterations, the hawk explored the search space (exploration phase). It took significant steps to detect the prey position. The length of these steps decreases as the hawk is near the prey position. The hawk spent a small number of iterations in the exploration due to the hybrid evolutionary-swarm updating mechanism. It avoided attempting on the local minim thanks to the high soaring stage based on the Levy function. The low soaring enhances the convergence speed in the exploitation phase, where the stooping and the swooping stages strengthen the RTH algorithm's accuracy. Figure 7 presents the hunting behavior for 2-dimensional and 3-dimensional problems. The hawk explores the whole search space from these figures to avoid attempting local solutions. Due to its unique updating mechanism gets closer to the optimal solution without falling into local ones with a fast convergence rate.

Figure 6
figure 6

Agents' evolution as a function of the iterations for a 2-dimensional problem.

Figure 7
figure 7

Agents' evolution for 2-dimensional and 3-dimensional problems.

To better understand the characteristics of the proposed RTH and its basics, the RTH concepts are presented in Table 1.

Table 1 The RTH concepts.
figure a

Results and discussion

RTH's performance was evaluated using several test functions. Three classes of test functions are used in this study:

  • Standard test functions54,

  • CEC 2020 benchmark test functions55,

  • CEC 2022 benchmark test functions56.

Standard test functions

Unimodal, multimodal, and fixed-dimension multimodal test functions are used to evaluate the RTH performance54. Unimodal test functions (F1-F7) are used to put an algorithm's exploitation abilities to the test, whereas multimodal test functions (F8-F13) are used to experiment with the algorithm's exploration performance. The fixed dimension test functions (TF14-TF23) demonstrate the algorithm exploration capability57. These functions are provided in Table A1 (appendix). For all the tests, the population size for each algorithm has been set at 30 with max iterations of 1000.

This study ran RTH 30 times and reported the findings, including the average and standard deviation values of the best-so-far solutions obtained in each run to provide statistically significant results. The test is carried out for six other algorithms to underline the effectiveness and superiority of RTH to that of different methods: Particle Swarm Optimization (PSO)37 as the best-known optimization method, Salp Swarm Algorithm (SSA)38 as one of the most used algorithms, Hunger Games Search (HGS)20, COOT algorithm19, Artificial Eco-system Optimizer (AEO)4, and Aquila Optimizer (AO)21 as recently developed metaheuristics. Table 2 summarizes the parameter setting for the RTH algorithm, where the parameters are set by the try-and-error method. The other algorithms are based on their default parameters. Table 3 shows the results of RTH and the other used algorithms on these standard test functions using the best, average, and standard deviation (StD) values.

Table 2 The RTH paramters.
Table 3 standard test functions results.
  • Unimodal functions results (F 01–07) because unimodal test functions have just one global optimum solution, they may be used to assess an algorithm's convergence speed (exploitation phase). From Table 3 results and the curves illustrated in Fig. 8 (fnc 05 curves are not included due to the exact similarity in the results), the RTH outperformed all algorithms in all test functions in terms of accuracy and convergence speed. These results demonstrate RTH's capabilities in quick exploitation, which can enable RTH in fast convergence. This capacity is derived from the high soaring phase that uses the adaptive transition factor (TF) and Lévy distribution.

    Figure 8
    figure 8

    Convergence curves of the unimodal functions.

  • Multimodal functions results (F 08–13) Multimodal test functions include multiple local solutions. Their number grows exponentially as the number of search space dimensions grows (optimization variables). Having more than one optimal is beneficial if the purpose is to test an algorithm's exploration capabilities. As a result, they are well-suited for assessing optimization algorithms' local optima avoidance and exploratory behavior. The obtained results in Table 3 and Fig. 9 demonstrated that RTH has superior exploration capabilities to other methods for five of six functions in terms of finding the optimal solution with the lowest number of iterations. These functions approve the ability of the RTH to handle complicated problems.

    Figure 9
    figure 9

    Convergence curves of the multimodal functions.

  • Fixed-dimensional multimodal function (F 14–23) similar to the multimodal test functions, these functions include a lot of local optima with more complexity due to the minimization of the negative cost function. Hence, they are suitable for evaluating the accuracy of the algorithm. As illustrated in Fig. 10 and reported in Table 3, the proposed RTH has reached the global optimum for all the considered functions. However, its robustness, represented by the standard deviation (StD), has been reduced to the increased complexity. RTH's exploration is due to its different optimization phases and the acceleration and gravity effects.

    Figure 10
    figure 10

    Convergence curves of the multimodal functions.

IEEE CEC 2020

The IEEE Congress on Evolutionary Computation (CEC) offers yearly benchmark functions to test and evaluate optimization algorithms' ability to identify optimal solutions (minimization problems). This collection of functions is commonly recognized by the year as standard functions established by the IEEE Congress on Evolutionary Computation, for example, CEC 2020 and CEC 2022. These test functions include unimodal, basic multimodal, hybrid, and composition functions. First, the proposed RTH will be compared with the considered algorithms using the ten functions of the IEEE CEC 202055. The characteristics of CEC 2020 functions are presented in Table A2. Their 3D maps are shown in Fig. 11 for the unimodal function (F1), Fig. 12 for the basic functions (F2-F4), and Fig. 13 for the composition functions (F8–F10).

Figure 11
figure 11

CEC 2020 F1 (unimodal) 3D map.

Figure 12
figure 12

CEC 2020 basic functions’ 3D map (F2–F4).

Figure 13
figure 13

CEC 2020 composition functions’ 3D map (F8–F10).

All the algorithms are run 30 times for each function. The results for these functions for D = 15 are presented in Table 4 and. These include the best, the main, and the standard deviation (StD). The fitness evolutions during the optimization process for each function are presented in Fig. 14.

Table 4 CEC 2020 benchmark test function results with D = 15.
Figure 14
figure 14

CEC 2020 fitness evolution for D = 15.

The three last rows show the scores of each algorithm. It can be seen from the L1 row that the proposed RTH can find the optimal solution for five functions from ten, followed by MGO by three functions, then HGS, AVOA, and GTO by two functions, where the other algorithms achieved only one optimal solution. From the penultimate row, the proposed RTG can accomplish the best mean results for five problems, followed by MGO by four, then HGS by two. The last row presents the StD results that confirm the algorithm's robustness. Based on these results, the proposed RTH provided the best results in this criterion four times. The evolution of the average cost function is presented in Fig. 13. From this figure, the proposed RTH has fast convergence speed compared to the other algorithms. This can be explained by the unique exploitation and exploitation strategies of the proposed RTH algorithm.

The functions of the CEC 2020 benchmark will be tested with increased search space dimension where D is equal to 20. This allows us to investigate the performance with more complex cases. The results are provided in Table 5.

Table 5 CEC 2020 benchmark test function results with D = 15.

It can be seen from the L1 row that the proposed RTH can find the optimal solution for six functions, followed by MGO by three, then HGS, AVOA, and GTO by two functions. From the penultimate row, the proposed RTG has got the best mean results for five problems, followed by MGO by three, then HGS by two. From the last row, the StD results of the RTH is the bet by five times, which confirms the algorithm's robustness. Based on these results, the proposed RTH provided the best results in this criterion four times. The evolution of the average cost function is presented in Fig. 15. Similar to the previous case, the proposed RTH has fast convergence speed compared to the other algorithms.

Figure 15
figure 15

CEC 2020 fitness evolution for D = 20.

ANOVA is the abbreviation for analysis of variance. ANOVA is frequently used to evaluate equality across different means by comparing variance between groups with variation within groups. This test will be used to assess the results between the optimizers for both D = 15 and D = 20 cases. The best outcome for each case is marked in red.

For the unimodal function (function 01), the ANOVA ranking is presented in Fig. 16. From this figure; the RTH generates the best solutions in terms of accuracy with the lowest variation range. On the other hand, the FO and the HHO cannot find any solution.

Figure 16
figure 16

CEC 2020 unimodal function (F1) ANOVA results.

For the basic functions (fnc 02–04), their results are presented in Fig. 17. For fnc 02 for both cases (D = 15 and D = 20), all the optimizers except for the F and the HHO got the optimal solution where the COOT provided the lower variation range and the MGO include the set of the best result. The results of function 03 are similar to those of function 02, with slight superiority to the HGS in precision and stability. For function 04, the RTH provided identical results for both cases (D = 15 and D = 20). This confirms its ability to resolve this problem effectively.

Figure 17
figure 17

CEC 2020 basic functions ANOVA results.

Hybrid functions (fnc 05–07) ANOVA results are presented in Fig. 18. The results of function 06 are not included because of the exact similarity of the results. These figures confirm the outperformance of the proposed RTH for the three functions compared to the other considered algorithms. The MGO and GTO algorithms performed the second best after the RTH.

Figure 18
figure 18

CEC 2020 hybrid functions ANOVA results.

Composition functions (fnc 08–10) ANOVA results are presented in Fig. 19. For function 08; the MGO provided the best performance where the proposed RTH for the best result, but its variation range is higher due to some ultimate results far from the best. The performance of the algorithms is much closer to each other except for the FO and the HHO for function 09, with light superiority for the MGO. The RTH provides more stable performance and higher accuracy for function 10, followed by the MGO.

Figure 19
figure 19

CEC 2020 composite functions ANOVA results.

IEEE CEC 2022

In this case, the proposed RTH will be compared with the considered algorithms using the 12 functions of the IEEE CEC 202256. The characteristics of CEC 2022 functions are presented in Table A3. Their 3D maps are illustrated in Fig. 20 for the unimodal function (F1), Fig. 21 for the basic functions (F2-F5), and Fig. 22 for the composition functions (F9-F12).

Figure 20
figure 20

CEC 2022 F1 (unimodal) 3D map.

Figure 21
figure 21

CEC 2022 basic functions’ 3D map (F2–F5).

Figure 22
figure 22

CEC 2022 composition functions’ 3D map (F9–F12).

Similar to the CEC 2020 cases, all the algorithms are run 30 times for each function for D = 10 and D = 20. The obtained results for these functions for D = 21 are presented in Table 6.

Table 6 CEC 2022 benchmark test function results for D = 10.

From the L1 row, the proposed RTH can find the optimal solution for eight from twelve functions, followed by GTO by six functions, then the HGS by five functions, then AVOA by four. This can approve its ability to get the optimal solution and escape from the local solutions. In comparison, FO, AO, and HHO cannot provide any best solution. From the penultimate row, the MGO achieved the best mean results by six functions, followed by the proposed RTH by five functions, then the HGS and GTO by two. This approves the accuracy of the proposed RTH. FO, COOT, AO, HHO, and AVOA algorithms didn't get any mean best results for all the tests. From the last row, the proposed RTH provided the best results by five functions, followed by the proposed MGO by four times. This can approve its robustness. Figure 23 presents the fitness evolution for each function of the CEC 2022 with D = 10. These figures support the findings of the CEC 2020, where the proposed RTH gives an excellent convergence speed.

Figure 23
figure 23

CEC 2022 fitness evolution for D = 10.

For D = 20 case, the results are provided in Table 7.

Table 7 CEC 2022 benchmark test function results for D = 10.

From the L1, the proposed RTH can find the optimal solution for six from twelve functions, followed by GTO by only three functions, then the HGS by two functions. The increased complexity can explain the decreased number of optimal solutions due to increased search space dimensions. These results approve the RTH's ability to get the optimal solution better and escape from the local solutions even in complicated problems. From L2, the MGO achieved the best mean results by five functions, followed by the proposed RTH by four. This approves the accuracy of the proposed RTH compared to the MGO algorithm. From L3, the proposed RTH provided the best results by five functions, followed by the proposed MGO by three times. This can approve its robustness. Compared to D = 10, the RTH can generally handle problems that include optimization variables better. Figure 24 presents the fitness evolution for each function of the CEC 2022 with D = 20. These figures approve the findings of the CEC 2020 and CEC 2022 with D = 10, where the proposed RTH presents a faster convergence speed.

Figure 24
figure 24

CEC 2022 fitness evolution for D = 10.

Figure 25 shows the ANOVA ranking results for unimodal functions for both cases. From this figure, the RTH and the MGO generate the best solutions in terms of accuracy with the lowest variation range for D = 10. However, when the search space dimensions increased, the performance of the MGO decreased where the RTH performance was constant.

Figure 25
figure 25

CEC 2022 unimodal function (F1) ANOVA results.

The basic functions (fnc 02–05) results are presented in Fig. 26. For fnc 02 for both cases (D = 15 and D = 20), all the optimizers except for the FO and the HHO got the optimal solution where the MGO and RTH provided the lower variation range for both cases. The results of fnc 03 show that the proposed RTH cannot resolve this problem effectively. The MGO and the HGS provide the best performance for this case. For fnc 04, all the optimizers provided near performance with a slight advantage to the MGO. The same comments can be extracted for fnc 05.

Figure 26
figure 26

CEC 2022 basic functions ANOVA results.

Hybrid functions (fnc 06–08) ANOVA results are presented in Fig. 27. The results of the fnc 06 confirm the outperformance of the proposed RTH. All the optimizers provide similar performance for the other two functions with an advantage to the MGO, HGS, and RTH algorithms.

Figure 27
figure 27

CEC 2022 hybrid functions ANOVA results.

Composition functions (fnc 09–12) ANOVA results are presented in Fig. 28. For function 09, the MGO and the RTH provided the best performance for both cases. For the other functions, the performance of the algorithms is much closer to each other, with light superiority for the FO and the HGS for fnc 10, the GTO and the RTH for fnc 11, and the MGO and the COOT for fnc 12.

Figure 28
figure 28

CEC 2022 composite functions ANOVA results.

These mathematical test functions are used to elaborate the performance of the proposed RTH algorithm compared to other new and robust algorithms. The statistical results are summarized in Fig. 29.

Figure 29
figure 29

Classes one test results.

From the results obtained, the RTH algorithm can provide very competitive performance for solving various optimization problems. The accuracy and stability of this proposed algorithm have been tested compared to the prementioned algorithms. The convergence speed has been checked and confirmed. After mathematically approving its performance, the proposed RTH algorithm will be tested with some published papers for several engineering tests.

Engineering optimization problems

As mathematics and engineering real-world complex examples, the proposed RTH algorithm will be used to solve seven real-world complex engineering problems.

  1. (a)

    Optimal design of I-Shaped beam: this issue, which tries to reduce the vertical deflection of the beam, is another common engineering optimization problem34. It satisfies the cross-sectional area and stress restrictions simultaneously under specific loads, as explained in Fig. 30. This optimization problem can be expressed as follows:

    $$\begin{aligned} & f(x) = \frac{5000}{{x_{3} {\raise0.7ex\hbox{${\left( {x_{2} - 2x_{4} } \right)^{3} }$} \!\mathord{\left/ {\vphantom {{\left( {x_{2} - 2x_{4} } \right)^{3} } {12}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${12}$}} + {\raise0.7ex\hbox{${x_{1} x_{4}^{3} }$} \!\mathord{\left/ {\vphantom {{x_{1} x_{4}^{3} } 6}}\right.\kern-0pt} \!\lower0.7ex\hbox{$6$}} + 2bx_{4} \left( {x_{2} - {\raise0.7ex\hbox{${x_{4} }$} \!\mathord{\left/ {\vphantom {{x_{4} } 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}}} \right)^{2} }} \\ & g_{1} (x) = 2x_{1} x_{3} + x_{3} \left( {x_{2} - 2x_{4} } \right) \le 300 \\ & g_{2} (x) = \frac{{18x_{2} \times 10^{4} }}{{x_{3} \left( {x_{2} - 2x_{4} } \right)^{3} + 2x_{1} x_{3} \left( {4x_{4}^{2} + 3x_{2} \left( {x_{2} - 2x_{4} } \right)} \right)}} + \frac{{15x_{1} \times 10^{3} }}{{\left( {x_{2} - 2x_{4} } \right)x_{3}^{2} + 2x_{3} x_{1}^{3} }} \le 56 \\ & 10 \le x_{1} \le 50,\,\,\,10 \le x_{2} \le 80,\,\,\,0.9 \le x_{3} \le 5,\,\,\,0.9 \le x_{4} \le 5 \\ \end{aligned}$$
    (9)

    where the optimization variables are: the width of the flange (x1), the height of the section (x2), the thickness of the web (x3), and the thickness of the flange (x4).

    Figure 30
    figure 30

    Cantilever beam schematic illustration.

From Table 8, the proposed RTH obtains the best solutions for solving this optimization problem compared to other published algorithms. In addition, the PFOA provided similar performance to the proposed RTH, but the RTH achieved the stop criteria after 300 iterations, proving better convergence speed and accuracy.

  1. (b)

    Three-bar truss design: In this example, a 3-bar planar truss is considered34, as represented in Fig. 31. The objective function and its constraints are presented as follows

    $$\begin{aligned} & f(x) = \left( {2\sqrt 2 x_{1} + x_{2} } \right) \times l \\ & g_{1} (x) = P\frac{{\sqrt 2 x_{1} + x_{2} }}{{\sqrt 2 x_{1}^{2} + 2x_{2} x_{1} }} - \sigma \le 0 \\ & g_{2} (x) = P\frac{{x_{2} }}{{\sqrt 2 x_{1}^{2} + 2x_{2} x_{1} }} - \sigma \le 0 \\ & g_{3} (x) = P\frac{{x_{2} }}{{\sqrt 2 x_{2} + x_{1} }} - \sigma \le 0 \\ & l = 100cm,\,\,P = 2{\raise0.7ex\hbox{${kN}$} \!\mathord{\left/ {\vphantom {{kN} {cm^{3} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${cm^{3} }$}},\,\,\,\sigma = 2{\raise0.7ex\hbox{${kN}$} \!\mathord{\left/ {\vphantom {{kN} {cm^{3} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${cm^{3} }$}},\,\,\,0 \le x_{1} ,\,\,\,x_{2} \le 1 \\ \end{aligned}$$
    (10)
    Table 8 Comparison of RTH results with the other algorithms for the I-shaped beam problem.
    Figure 31
    figure 31

    Three-bar truss schematic illustration.

Table 9 provides the statistical results of these algorithms. It is clear that the best results are obtained using the proposed RTH algorithm and the AHA optimizer. However, the required number of iterations is only 670, much lower than the other reported algorithms, including the AHA, which requires 15,000 iterations to achieve the optimal value.

  1. (c)

    Design of a tubular column: this problem illustrates the structure of a uniform column with a tubular cross-section that can support a compressive load at the lowest possible cost34, as explained in Fig. 32. The two design variables in this issue are the mean diameter of the column (x1) and the thickness of the tube (x2). The column is constructed from a material having a yield stress of y and an elasticity modulus of E. The following equation represents this optimization problem:

    $$\begin{aligned} & f(x) = 9.8x_{1} x_{2} + 2x_{2} \\ & g_{1} (x) = \frac{P}{{\pi x_{2} x_{1} \sigma_{y} }} - 1 \le 0 \\ & g_{2} (x) = \frac{{8PL^{2} }}{{\pi^{3} Ex_{2} x_{1} \left( {x_{1}^{2} + x_{2}^{2} } \right)}} - 1 \le 0 \\ & g_{3} (x) = \frac{2}{{x_{1} }} - 1 \le 0,\,\,g_{4} (x) = \frac{{x_{1} }}{14} - 1 \le 0,\,\, \\ & g_{5} (x) = \frac{2}{{x_{2} }} - 1 \le 0,\,\,g_{6} (x) = \frac{{x_{2} }}{8} - 1 \le 0 \\ & \sigma_{y} = 500{\raise0.7ex\hbox{${kgf}$} \!\mathord{\left/ {\vphantom {{kgf} {cm^{2} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${cm^{2} }$}},\,\,P = 0.85 \times 10^{6} {\raise0.7ex\hbox{${kgf}$} \!\mathord{\left/ {\vphantom {{kgf} {cm^{3} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${cm^{3} }$}},\,\,\,\,\,2 \le x_{1} \le 14,\,\,\,0.2 \le x_{2} \le 0.8 \\ \end{aligned}$$
    (11)
    Table 9 Comparison of RTH results with the other used algorithms for the three-bar truss design problem.
    Figure 32
    figure 32

    Tubular column schematic illustration.

This problem has already been tackled using several algorithms. The best results of these algorithms, as well as the suggested RTH, are shown in Table 10. Based on these results, the proposed RTH achieved the best results with the lowest number of iterations (300).

  1. (d)

    Speed Reducer Design: speed reducer is an essential part of the gearbox in mechanical systems. It may be used for a variety of purposes71. As shown in Fig. 33, the weight of the speed reducer must be reduced under 11 restrictions in this optimization problem. Face width (x1), the module of teeth (x2), number of teeth in the pinion (x3), length of the first shaft between bearings (x4), length of the second shaft between bearings (x5), the diameter of first shafts (x6), and diameter of the second shafts (x7) are the seven variables in this issue. This problem can be modeled as

    $$\begin{aligned} & f(x) = 0.7854x_{1} x_{2}^{2} \left( {3.3333x_{3}^{2} + 14.9334x_{3} - 43.0934} \right) \\ & - 1.508x_{1} \left( {x_{6}^{2} + x_{7}^{2} } \right) + 7.4777\left( {x_{6}^{3} + x_{7}^{3} } \right) + 0.7854\left( {x_{4} x_{6}^{2} + x_{5} x_{7}^{2} } \right) \\ & g_{1} (x) = \frac{27}{{x_{1} x_{3} x_{2}^{2} }} - 1 \le 0,\,\,\,g_{2} (x) = \frac{397.5}{{x_{1} x_{3} x_{2}^{2} }} - 1 \le 0 \\ & g_{3} (x) = \frac{1.93}{{x_{2} x_{3} x_{6}^{4} }} - 1 \le 0,\,\,\,g_{4} (x) = \frac{{1.93x_{5}^{3} }}{{x_{2} x_{3} x_{7}^{4} }} - 1 \le 0 \\ & g_{5} (x) = \frac{{\sqrt {\left( {{\raise0.7ex\hbox{${745x_{4} }$} \!\mathord{\left/ {\vphantom {{745x_{4} } {x_{2} x_{3} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${x_{2} x_{3} }$}}} \right)^{2} + 16.9 \times 10^{6} } }}{{110x_{6}^{3} }} - 1 \le 0 \\ & g_{6} (x) = \frac{{\sqrt {\left( {{\raise0.7ex\hbox{${745x_{5} }$} \!\mathord{\left/ {\vphantom {{745x_{5} } {x_{2} x_{3} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${x_{2} x_{3} }$}}} \right)^{2} + 157.5 \times 10^{6} } }}{{85x_{7}^{3} }} - 1 \le 0 \\ & g_{7} (x) = \frac{{x_{2} x_{3} }}{40} - 1 \le 0,\,\,\,g_{8} (x) = \frac{{5x_{2} }}{{x_{1} }} - 1 \le 0,\,\,\,g_{9} (x) = \frac{{x_{1} }}{{12x_{2} }} - 1 \le 0 \\ & g_{10} (x) = \frac{{1.5x_{6} + 1.9}}{{x_{4} }} - 1 \le 0,\,\,\,g_{9} (x) = \frac{{1.1x_{7} + 1.9}}{{x_{5} }} - 1 \le 0 \\ & 2.6 \le x_{1} \le 3.6,\,\,\,0.7 \le x_{2} \le 0.8,\,\,x_{3} \in \left[ {17,18, \cdots 28} \right],\,\,x_{4} \ge 7.3 \\ & x_{5} \le 8.3,\,\,\,2.9 \le x_{6} \le 3.9,\,\,\,5 \le x_{7} \le 5.5 \\ \end{aligned}$$
    (12)
    Table 10 RTH results and the other used algorithms for tubular column designing problem.
    Figure 33
    figure 33

    Speed reducer design schematic illustration.

The results of RTH and other published algorithms are reported in Table 11. Among these algorithms, the RTH has the lowest number of iterations, while its metrics in terms of best, mean, and StD are better than those other algorithms.

  1. (e)

    Piston lever: the essential goal of this problem is to identify the piston components (x1), (x2), (x3), and (x4) by reducing the oil volume when the piston's lever is raised from 0° to 45°34. This problem is presented in Fig. 34, and it can be modeled as follows:

    $$\begin{aligned} & f(x) = \frac{1}{4}\pi x_{3}^{2} \left( {L_{2} - L_{1} } \right) \\ & g_{1} (x) = QL\cos (\theta ) - RF \le 0 \\ & g_{2} (x) = Q\left( {L - x_{4} } \right) - M_{\max } \le 0 \\ & g_{3} (x) = 1.2\left( {L_{2} - L_{1} } \right) - L_{1} \le 0 \\ & g_{4} (x) = \frac{{x_{3} }}{2} - x_{2} \le 0 \\ & R = \frac{{ - x_{4} \left( {x_{4} \sin (\theta ) + x_{1} } \right) + x_{1} \left( {x_{2} - x_{4} \cos (\theta )} \right)}}{{L_{1} }} \\ & F = {\raise0.7ex\hbox{${\pi Px_{3}^{2} }$} \!\mathord{\left/ {\vphantom {{\pi Px_{3}^{2} } 4}}\right.\kern-0pt} \!\lower0.7ex\hbox{$4$}},\,\,L_{1} = \sqrt {(x_{4} - x_{2} )^{2} + x_{1}^{2} } ,\,\,\,L_{2} = \sqrt {\left( {x_{4} \sin (\theta ) + x_{1} } \right)^{2} + \left( {x_{2} - x_{4} \cos (\theta )} \right)^{2} } \\ & \theta = 45^\circ ,\,\,\,Q = 10000{\text{lbs}},\,\,L = 240{\text{in}},\,\,1.8 \times 10^{6} {\text{lbs}}{\text{.in,}}\,\,P = 1500{\text{psi}} \\ & 0.05 \le x_{1} \le 500,\,\,\,0.05 \le x_{2} \le 120 \\ \end{aligned}$$
    (13)
    Table 11 Comparison of RTH results with other algorithms for speed reducer designing problems.
    Figure 34
    figure 34

    Piston lever design schematic illustration.

According to the obtained results in Table 12, the SNS performs better than the proposed RTH algorithm in terms of mean and StD. However, achieving the stop criteria took many iterations (5000), whereas the RTH requires only 130 iterations.f) Corrugated design: This task seeks to reduce the weight of a corrugated bulkhead in a chemical tanker66. The optimization variables are width (x1), depth (x2), length (x3), and plate thickness (x4). Its mathematical model of this problem can be expressed as follows:

$$\begin{aligned} & f(x) = \frac{{5.885x_{4} \left( {x_{1} + x_{3} } \right)}}{{x_{1} + \sqrt {\left| {x_{3}^{2} - x_{2}^{2} } \right|} }} \\ & g_{1} (x) = - x_{4} x_{2} \left( {0.4x_{1} + \frac{{x_{3} }}{6}} \right) + 8.94\left( {x_{1} + \sqrt {\left| {x_{3}^{2} - x_{2}^{2} } \right|} } \right) \le 0 \\ & g_{2} (x) = - x_{4} x_{2}^{2} \left( {0.2x_{1} + \frac{{x_{3} }}{12}} \right) + 2.2\left( {8.94(x_{1} + \sqrt {\left| {x_{3}^{2} - x_{2}^{2} } \right|} )} \right)^{\frac{4}{3}} \le 0 \\ & g_{3} (x) = - x_{4} + 0.0156x_{1} + 0.015 \le 0 \\ & g_{4} (x) = - x_{4} + 0.0156x_{3} + 0.015 \le 0 \\ & g_{5} (x) = - x_{4} + 0.015 \le 0 \\ & g_{6} (x) = x_{2} - x_{3} \le 0 \\ & 0 \le x_{1} ,\,\,\,x_{2} \le 100,\,\,x_{3} \le 100,\,\,4 \le x_{4} \le 5, \\ \end{aligned}$$
(14)
Table 12 Comparison of RTH results with the other used algorithms for the piston lever problem.

The statistical results of this problem are provided in Table 13. Although AOA achieved the best results, these results were only obtained after 40,000 iterations, unlike the proposed RTH for the stop value after 129 iterations, which approves its solving speed.g) Design of tension/compression spring: tension/compression spring design challenge aims to decrease the weight of a tension/compression spring, as detailed in78 and Fig. 35. Minimum deflection, shear stress, surge frequency, outside diameter limitations, and design factors all play a role in this problem. The optimization variables include the mean coil diameter (x1), the wire diameter (x2), and the number of active coils (x3). This problem can be expressed as follows:

$$\begin{aligned} & f(x) = \left( {x_{3} + 2} \right)x_{2} x_{1}^{2} \\ & g_{1} (x) = 1 - \frac{{x_{3} x_{2}^{3} }}{{71785x_{1}^{4} }} \le 0 \\ & g_{2} (x) = \frac{{x_{3} x_{2}^{3} }}{{12566\left( {x_{2} x_{1}^{3} - x_{1}^{4} } \right)}} + \frac{1}{{5108x_{1}^{2} }} - 1 \le 0 \\ & g_{3} (x) = 1 - \frac{{140.45x_{1} }}{{x_{3} x_{2}^{2} }} \le 0,\,\,\,g_{4} (x) = \frac{{x_{1} + x_{2} }}{1.5} \le 0 \\ & 0.05 \le x_{1} \le 2,\,\,\,0.05 \le x_{1} \le 2,\,\,\,0.05 \le x_{1} \le 2,\,\,\, \\ \end{aligned}$$
(15)
Table 13 Comparison of RTH results with the other used algorithms for the corrugated bulkhead design problem.
Figure 35
figure 35

Speed reducer design schematic illustration.

Table 14 compares the RTH statistical results with other MAs. The RTH algorithm solves this problem in only 130 iterations, much less than the other considered algorithms with better results.

Table 14 Comparison of RTH results with the other used algorithms for tension/compression spring design problem.

Proton Exchange membrane fuel cell parameters' identification

Fuel cells are recent energy-generation devices that produce efficient power by directly using fuel (mainly hydrogen) and oxygen while emitting no pollutants or noise (water, heat, and electricity). Because of its benefits and wide range of applications, proton exchange membrane fuel cells (PEMFCs) that employ polymers as electrolytes are becoming more prominent85,86. Fuel cell modeling is a crucial stage that enables the investigation and improvement of its performance87. The PEMFC model is built from nonlinear differential equations that explain internal chemical processes. These equations contain various empirical parameters that must be accurately identified to improve model accuracy. As a result, identifying these parameters is essential for creating an accurate model.

PEMFC model

The PEMFC output voltage can be provided as follows88

$$V_{fc} = E_{Nernest} - V_{act} - V_{ohm} - V_{con}$$
(16)

where Vact is the activation voltage losses, Vohm is the ohmic voltage losses, Vcon represents the concentration voltage losses, and ENernest denotes the thermodynamic potential voltage (the Nernst voltage). ENernest can be calculated as follows:

$$E_{Nernest} = 1.229 - 0.85 \times 10^{ - 3} (T - 298.15) + 4.3085 \times 10^{ - 5} \times T\left( {\ln (P_{{H_{2} }} ) + \frac{{\ln (P_{{O_{2} }} )}}{2}} \right)$$
(17)

where T represents the operating temperature, PH2 and PO2 are the partial pressures of the hydrogen and the oxygen, respectively. They can be calculated as follows:

$$P_{{H_{2} }} = 0.5 \times R_{ha} \times P_{{H_{2} O}} \left[ {\frac{1}{{\frac{{R_{ha} \times P_{{H_{2} O}} }}{{P_{a} }} \times e^{{\frac{{1.635\left( {{i \mathord{\left/ {\vphantom {i A}} \right. \kern-0pt} A}} \right)}}{{T^{1.334} }}}} }} - 1} \right]$$
(18)
$$P_{{H_{2} }} = 0.5 \times R_{ha} \times P_{{H_{2} O}} \left[ {\frac{1}{{\frac{{R_{ha} \times P_{{H_{2} O}} }}{{P_{a} }} \times e^{{\frac{{1.635\left( {{i \mathord{\left/ {\vphantom {i A}} \right. \kern-0pt} A}} \right)}}{{T^{1.334} }}}} }} - 1} \right]$$
(19)

where Rha and Rhc represent the vapor humilities of both anode and cathode, Pa and Pc present the inlet pressures of both anode and cathode (atm), A is the electrode surface (cm2), i is the current of the FC (A), and PH2O represents the water vapor saturation pressure(atm).

The activation voltage losses (Vact) can be obtained as

$$V_{act} = - \left( {\zeta_{1} + \zeta_{2} T + \zeta_{3} T\ln (C_{{O_{\partial } }} ) + \zeta_{4} T\ln (i)} \right)$$
(20)

where ξ1, ξ2, ξ3, ξ4 denote semi-empirical parameters; CO2 is the concentration of oxygen at the cathode's surface (mol.cm−3). It can be calculated as follows:

$$C_{{O_{2} }} = \frac{{P_{{O_{2} }} }}{{5.08 \times 10^{6} }}e^{{^{{\left( \frac{498}{T} \right)}} }}$$
(21)

The ohmic losses (Vohm) can be obtained as

$$V_{ohm} = i(R_{m} + R_{c} )$$
(22)

where Rc is the resistance of the connectors, and Rm is the resistance of the membrane. Rm can be calculated as

$$R_{m} = \rho_{m} \left( {\frac{l}{{A_{m} }}} \right)$$
(23)

where l and Am represent the membrane thickness (cm) and surface (cm2), respectively, and ρm represents the membrane-specific resistivity (ohm × cm). ρm can be obtained as

$$\rho_{m} = \frac{{181.6\left[ {1 + 0.03{\raise0.7ex\hbox{$i$} \!\mathord{\left/ {\vphantom {i {A_{m} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${A_{m} }$}} + 0.062{\raise0.7ex\hbox{$T$} \!\mathord{\left/ {\vphantom {T {303}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${303}$}}\left( {{\raise0.7ex\hbox{$i$} \!\mathord{\left/ {\vphantom {i {A_{m} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${A_{m} }$}}} \right)^{2.5} } \right]}}{{\left[ {\lambda - 0.634 - 3{\raise0.7ex\hbox{$i$} \!\mathord{\left/ {\vphantom {i {A_{m} }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${A_{m} }$}}} \right]e^{{4.18\frac{T - 303}{T}}} }}$$
(24)

where λ is the membrane material's water content.

Objective function

The sum square error (SSE) between the measured (Vdata) and model output data (Vdata) will be used as an objective function. The objective function can be constructed as follows:

$$f(x) = \sum\nolimits_{k = 1}^{N} {(V_{data} (k) - V_{model} (k,x))^{2} }$$
(25)

where N represents the data size, and x represents a vector containing seven unknown parameters.

$$x = \left[ {\begin{array}{*{20}c} {\zeta_{1} } & {\zeta_{2} } & {\zeta_{3} } & {\zeta_{4} } & {R_{c} } & {\begin{array}{*{20}c} \lambda & b \\ \end{array} } \\ \end{array} } \right]$$
(26)

The FC data are compared with those generated by the model, and the fitness value is calculated based on the error between them. The model is developed in MATLAB script, and the data are loaded from the Excel sheet file. The identification is an iterative process that updates the candidate solutions at each iteration by sending them to the MATLAB script that includes the FC model and simulates it after that, and then generates the fitness value. This process repeated until the last iteration.

Results

The suggested RTH algorithm will be used to extract the seven unknown characteristics of three PEM fuel cells: the NedStack PS6, the BCS 500W, and the SR-12 500W. Table 1587 provided the accurate values of the parameters, testing operating conditions, and measurement data for the tested PEMFC types. The upper and lower limits of the empirical parameters are presented in Table 16. The results are compared to those published for the same FC types.

Table 15 The characteristics of the considered PEMFCs.
Table 16 The upper and the lower limits of the empirical parameters.

Table 17 shows the comparative findings for the BCS 500 W type, Table 18 for the NedStack PS6, and Table 19 for the SR-12 PEM 500 W. The comparison findings are primarily based on sum square error (SSE).

Table 17 The extracted BSC 500W FC parameters.
Table 18 The extracted NedStack PS6 FC parameters.
Table 19 The extracted SR-12 500W FC parameters.

Based on the findings reported in Table 17, the suggested method-based RTH performed the best of all the reported techniques in this comparison to extract the parameters of the BCS 500W. The proposed RTH algorithms obtained the minimal fitness function (SSE) by 1.14 × 10−2. On the other hand, the mean fitness values were similar to the best value. The RTH provides the lowest STD values compared to the different algorithms (9.37 × 10−8), indicating its robustness. Figure 36 depicts the experimental and estimated voltage and power curves of BCS 500W using the suggested RTH algorithm. The estimated voltage and power curves match the experimental curves. These curves demonstrate the proposed algorithm's accuracy in deriving the best BCS 500W parameters.

Figure 36
figure 36

Voltage and power curves of BCS 500W using the proposed RTH algorithm.

Similar to the BDC 500W case, the suggested method-based RTH performed the best of all the cited methods in this comparison to extract the parameters of the NedStack PS6. The proposed RTH best result is 2.058, similar to the mean values. The RTH provides the lowest StD values compared to the different algorithms (1.79 × 10−6), approving its robustness. Figure 37 depicts the experimental and estimated voltage and power curves of NedStack PS6 using the suggested RTH algorithm. The estimated voltage and power curves match the experimental curves.

Figure 37
figure 37

Voltage and power curves of BCS 500W using the proposed RTH algorithm.

Similar to the previous cases, the suggested method-based RTH performed the best of all the cited methods in this comparison to extract the parameters of the SR 500W. The proposed RTH best result is 0.5607, similar to the mean values. The RTH also provides the lowest StD value by 1.79 × 10−6, approving its robustness. Figure 38 shwos the experimental and estimated voltage and power curves of SR 500W using the suggested RTH algorithm.

Figure 38
figure 38

Voltage and power curves of SR-12 500W using the proposed RTH algorithm.

The obtained results for the standard test functions evaluated the performance of the proposed RTH algorithm for both exploitation and exploitation phases compared to other MAs. From these results, the proposed RTH has excellent exploitation and exploration abilities. In addition, its convergence speed has been approved. Then, the proposed RTH efficiently has been evaluated for several real-world applications. Its performance has been compared to several published algorithms for each problem. The achieved results confirm its ability to handle these problems. Finally, a PEMFC parameters extraction has been performed using the proposed RTH algorithm. The results have been compared to other well-known algorithms to approve its performance. The results achieved were excellent. Hence, its performance has been elaborated and approved for various types of optimization problems.

Conclusion and future works

This paper has proposed a novel metaheuristic optimization algorithm named the red-tailed hawk (RTH) algorithm to solve various optimization tasks and problems. The proposed RTH is inspired by the red-tailed hawk's hinting behaviors of a predatory bird. A mathematical model has been developed to replicate the behavior of red-tailed hawks. The main contribution of this paper is to propose a new optimizer that has high robustness and fast convergence speed when solving various optimization problems. RTH's performance was firstly evaluated using three types of mathematical functions that express the nature of different optimization problems: twenty-three standard benchmark test functions, IEEE Congress on Evolutionary Computation 2020 (CEC2020) with 15 and 20 search space dimensions, and CEC2022 with 10 and 20 search space dimensions. These functions enable evaluating the exploitative ability, exploratory ability, and local optima avoidance of RTH. The results are compared to other recent and robust optimizers, including Farmland Fertility Optimizer (FO), African Vultures Optimization Algorithm (AVOA), Mountain Gazelle Optimizer (MGO), Gorilla Troops Optimizer (GTO), COOT algorithm, Hunger Games Search (HGS), Aquila Optimizer (AO), and Harris Hawks optimization (HHO). The results show that the proposed algorithm can provide the optimal solution for most of the considered functions with fast convergence speed and good robustness. Then, the findings of the seven constrained engineering design problems demonstrated that the RTH could show superior results to other published algorithms in terms of precision, robustness, and convergence rate. To deeply investigate the performance of the proposed RTH, the results of the proton exchange membrane fuel cell parameters extractions (PEMFC) have used the proposed RTH algorithm compared to published ones. The ultimate results show the RTH's ability to find better parameters for the dynamic model of the PEMFC.

RTH’s performance is anticipated to be considerably improved by integrating more complicated processes and combining effective operators and technics of other heuristics. Enhancing the proposed algorithm by including other factors in the model, such as the wind effect and prey escaping, is possible. However, the bigger code size of the RTH compared to other algorism like the PSO and the SSA can be a problem for its implementation. Bus, this problem can be bypassed with the utilization of fast calculators.