Introduction

Currently, global concerns are directed towards investing in carbon-free energy sources due to the severe ecological impacts of fossil fuel-based energy sources1,2. Besides, the rise in prices of fossil fuel due to international conflicts and its limited existence have expedited the necessity to find sustainable and environmentally friendly energy sources3. Amongst such clean sources, fuel cells (FCs) are considered as a new booming application of renewable energy-based conversion technology4. Principally, FCs convert chemical energy into electrical and heat energies. Due to their higher conversion efficiencies, robustness, and almost zero emissions, FCs are compatible to be utilized in whatever application either in industrial, commercial, or residential sectors5. According to the electrolyte substance, FCs are divided into various types. Each one has unique features represented by the output power range, the operating temperatures, and the appropriate applications6. Particularly, proton exchange membrane FCs (PEMFCs)7, solid oxide FCs8, alkaline FCs9, phosphoric acid FCs10, and molten carbonate FCs11 are examples of FC’s types.

PEMFCs have gained wide popularity because of their attractive characteristics such as low operating pressures and temperatures, high power density, compact size, and no dynamic parts. However, the high cost of the catalyst hinders their market dominancy4,5,6. Moreover, the output voltage per cell varies from 0.9 to 1.23 V depending on the temperature value and the suppliant pressures, hence, a group of PEMFCs are connected serially to magnify the output voltage to a desire level. This group of PEMFCs is called a stack12. Additionally, their output voltage exhibits a non-linear relationship with the load current caused by the polarization losses. In other words, the PEMFC’s output voltage starts falling rapidly due to the activation voltage drop, then it decreases linearly because of the ohmic voltage drop, and finally it extremely decays due to concentration losses13.

Since modelling the PEMFCs suffers from a high degree of non-linearity, robust techniques are vital to precisely simulate the electrical characteristics of the PEMFCs, and hence, properly assess their performance. Thus, numerous researchers have proposed several models to describe the PEMFC’s operation from different perspectives4,5,6. Generally, PEMFC’s models are categorized as empirical, semi-empirical, and analytical models, as reported in14,15,16,17. In this article, a semi-empirical electrochemical model, proposed by Amphlett et al.6,18, is utilized to properly evaluate the simulated steady-state electrical characteristics of PEMFCs. During recent decades, Amphlett’s model has acquired a reputed acknowledgment as a result of its powerful ability to predict the electrical behavior of the PEMFCs in various operating environments4,5,6,18.

Nevertheless, the mathematical representation of such a model includes a set of undefined parameters that aren’t stated in the fabricators’ datasheets. These parameters need to be optimally estimated so that the model can perfectly emulate the actual behavior of the PEMFCs. Accordingly, vast attempts have been conducted to completely define the unspecified parameters of the PEMFC’s model. Basically, these attempts can be classified into conventional and artificial intelligence (AI)-based optimization ones4,5,6,7.

For instance, the techniques based on electrochemical impedance spectroscopy19, adaptive filter20, and current switching21 are representatives of the conventional trials. However, they aren’t broadly employed as their construction relies on the iterative techniques derived from different numerical approaches. Thence, the model’s startup conditions, complexity, and iteration steps are the dominant factors affecting the accuracy of such methods. On the contrary, the AI-based methods, represented by metaheuristic optimization algorithms (MOAs), are dependent on the specs of the computer processor on which the optimization task is carried out, which make them more reliable and effective. Consequently, a huge number of researchers have applied MOAs in estimating the unknown parameters of the PEMFC’s model4,5,6,7,12,22.

Specifically, artificial bee colony-differential evolution algorithm (ABCDEA)23, artificial ecosystem algorithm (AEA), ant lion algorithm (ALA), and multi-verse algorithm (MVA)24, and artificial rabbits algorithm (ARA)25 are examples of MOAs, involved in the PEMFC parameter estimation task. Besides, bi-subgroup algorithm (BSA)26, chaotic Harris hawks algorithm (CHHA)27, converged moth search algorithm (CMSA)28, circle search algorithm (CSA)29, evaporation rate water cycle algorithm (ERWCA)21, enhanced transient search algorithm (ETSA)30, and firefly algorithm (FFA)31 are applied for the afore purpose. Not only the previous-mentioned algorithms but also, gorilla troops algorithm (GTA)32, hunger games search algorithm (HGSA)33, improved chicken swarm optimizer (ICSO)34, improved fluid search algorithm (IFSA)35, Jellyfish search algorithm (JSA)36, lightning search algorithm (LSA)37, and many mor are employed for the same goal4,5,6.

According to the "no free lunch" (NFL) theory38, each optimization technique has advantages and disadvantages for particular jobs, hence there isn't a single algorithm that can solve all engineering optimization issues. Furthermore, there is still no conclusive answer, and it can be challenging to choose between optimization methods X and Y depending on factors like degree of non-linearity, non-convexity, multi-modality, separability of the control variables, high dimensionality, etc. The attempts will continue till such a response is received in these undertakings. Even though there have been many successful methods to establish these parameters, as indicated above, there is always potential for improvement to more precisely address the best PEMFCs stack model values.

It's self-explanatory from the previous short review that specifying the unidentified parameters of Amphlett’s model became a critical research area, at which the aforementioned algorithms struggle to attain minimum errors, lower computational burden, and superior statistical metrics. The earlier stated has encouraged the authors to assess the efficacy of a new physics-based MOA, named Kepler optimization algorithm (KOA) introduced in 202339, in generating the ungiven parameters of four well-reputed PEMFCs’ stacks. It’s worth declaring that the KOA possesses significant features like a smooth transition from exploration to exploitation to escape from local minima trap, rapid convergence tendency, and lower execution time. It’s worth noting that based on the authors’ awareness, upon an accurate investigation, it’s the first employment of the KOA in the PEMFC’s parameter-specifying task.

It's time to call attention to the main contributions of this article, which include: (i) using and examining KOA’s performance to optimally assign the values of unknown parameters in the Amphlett's model, (ii) carefully examining four real-world study cases, Ballard Mark V, BCS 0.5 kW, NedStack 6 kW, and Temasek 1 kW, and (iii) Numerous statistical comparisons among the KOA optimizer and other recent and benchmark optimizers are performed, and (iv) Amphlett's model is modified to more accurately capture the dynamic behavior of PEMFCs stack before a real-world test case is evaluated for its dynamic responses.

This paper is organized as follows: Section "Introduction" introduces a summarized review and the motivation of the current endeavor. The mathematical formation of Amphlett’s model is deeply discussed in Section "Mathematical formulation of PEMFCs’ model". Section "Cost function allocation" announces the allocated cost function (CF) and its relevant boundaries. Section "Kepler optimization algorithm" illustrates the procedures of KOA. Various simulated test cases under different steady-state conditions, as well as executing some statistical tests to evaluate the KOA’s performance are revealed in Section "Numerical simulations and algorithm verification". A simplified trial to update Amphlett’s model so that it can describe the electrical dynamic response of the PEMFCs is introduced in Section "Dynamic assessment of PEMFCs stack". Lastly, Section "Conclusion and future prospective" announces the conclusion and the future perspectives.

Mathematical formulation of PEMFCs’ model

As formerly-stated, Amphlett’s model is regarded as the most powerful method to simulate the dependency of the PEMFC’s terminal voltage on the load current through various steady-state cases22,23,24. In order to examine the PEMFCs stack in operation, Mann and Amphlett's PEMFCs model makes a number of simplifying assumptions18,40. Here are a few of these presumptions: (i) The fuel and oxidant gas compositions are constant and precisely blended throughout the entire cell, (ii) The electrodes completely consume the fuel and oxidant, preventing any buildup inside the cell, (iii) There is no gas mixing between the anode and cathode compartments because the fuel and oxidant gases run parallel to the electrodes, and (iv) The porosity and thickness of the material do not change over time, (v) The fuel and oxidant gases' temperature, pressure, and humidity remain constant across the entire cell, and (vi) the electrolyte is a perfect ion conductor with no limits on electronic conductivity or mass transfer.

In spite of the aforementioned, the Mann’s model can be extended to describe the transient behavior as well24. Amphlett supposes that the PEMFC’s terminal voltage is subjected to three voltage decays which are the activation, the ohmic, and the concentration voltage drops, as described in Fig. 129. The next few statements concisely illustrate the model, as thoroughly described in the state-of-the-art. The terminal voltage per single cell \({V}_{cl}\) (\(V\)), is given by (1)25.

$${V}_{cl}={E}_{n}-{V}_{ac}-{V}_{oh}-{V}_{cn}$$
(1)

where, \({E}_{n}\) is the Nernst open-circuit voltage per PEMFC in (\(V\)), \({V}_{ac}\) is the activation over-potential in (\(V\)) as the startup chemical reactions are relatively slow, \({V}_{oh}\) is the ohmic voltage loss due to the total resistance of the membrane and external leads in (\(V\)), and \({V}_{cn}\) is the concentration over-potential due to the high water content in the membrane at heavy loading in (\(V\)).

Figure 1
figure 1

Equivalent circuit per cell.

As earlier-mentioned, to attain a high terminal voltage, \(N\) PEMFCs are connected in series creating a PEMFCs’ stack whose terminal voltage is \({V}_{st}\) (\(V\)) and calculated by (2)26.

$${V}_{st}=N\cdot {V}_{cl}$$
(2)

Generally, (2) supposed that all the PEMFCs are identical and behaves the same6.

The \({E}_{n}\) can be calculated by (3) for \(T\le 373.15 K\)27.

$${E}_{n}=1.229-8.5\times {10}^{-4} \left(T-298.15\right)+4.3085\times {10}^{-5}\times T\left[ln\left(\sqrt{{({P}_{H})}^{2}{P}_{O}}\right)\right] $$
(3)

where, the partial pressures of hydrogen and oxygen are represented by \({P}_{H}\) and \({P}_{O}\) in (\(atm\)) and determined by (4) and (5), respectively25. \(T\) is the PEMFCs’ stack operating temperature in (\(K\)).

$${P}_{H}=0.5\cdot {RH}_{a}\cdot {P}_{w}.\left[\left[\frac{1}{\frac{{RH}_{a}\cdot {P}_{w}}{{P}_{a}}\cdot exp\left(\frac{1.635I}{{A}_{m}\cdot {T}^{1.334}}\right)}\right]-1\right]$$
(4)
$${P}_{O}={RH}_{c}\cdot {P}_{w}\cdot \left[\left[\frac{1}{\frac{{RH}_{c}\cdot {P}_{w}}{{P}_{c}}\cdot exp\left(\frac{4.192I}{{A}_{m}{\cdot T}^{1.334}}\right)}\right]-1\right]$$
(5)

where, the load current and membrane useful area are denoted by \(I\) and \({A}_{m}\) in (\(\mathrm{A}\)) and (\({\mathrm{cm}}^{2}\)), respectively.

\({RH}_{a}\) and \({RH}_{c}\) express the relative humidities of the water steam at the anode and cathode regions, respectively. The anode and the cathode inlet pressures are indicated by \({P}_{a}\) and \({P}_{c}\) in (\(\mathrm{atm}\)), respectively. The saturated vapor pressure is symbolized by \({P}_{w}\) in (\(\mathrm{atm}\)), which can be given by (6)29.

$${log}_{10}({P}_{w})=0.0295\left(T-273.15\right)-9.18.{10}^{-5}{\left(T-273.15\right)}^{2}+0.0144\cdot {10}^{-5}{\left(T-273.15\right)}^{3}-2.18$$
(6)

Moreover, \({V}_{ac}\) can be computed by (7)30.

$${V}_{ac}=-[{\zeta }_{1}+{\zeta }_{2}\cdot T+{\zeta }_{3}\cdot T\cdot ln({C}_{O})+{\zeta }_{4}\cdot T\cdot ln(I)]$$
(7)

where, \({\zeta }_{z} ( z=1:4\)) refer to semi-empirical factors in (\(V,V{K}^{-1},V{K}^{-1},V{K}^{-1}\)). \({C}_{O}\) symbolizes the oxygen concentration at the catalytic region in (\(\mathrm{mol }{\mathrm{cm}}^{-3}\)), which is formulated by (8)31.

$${C}_{O}=\frac{{P}_{O}}{5.08.{10}^{6}}\cdot exp(\frac{498}{T})$$
(8)

Furthermore, \({V}_{oh}\) can be expressed by (9)32.

$${V}_{oh}=I\cdot \left({R}_{m}+{R}_{l}\right); {R}_{m}={\rho }_{m}\left(\frac{l}{{A}_{m}}\right)$$
(9)

where, the resistances of the membrane and leads are denoted by \({R}_{m}\) and \({R}_{l}\) in (\(\Omega )\), respectively. \(l\) points out the membrane thickness in (\(cm\)). The membrane specific resistivity is represented by \({\rho }_{m}\) in (\(\mathrm{\Omega cm}\)) and determined by (10)33.

$${\rho }_{M}=\frac{181.6\left[1+0.03\left(\frac{I}{{A}_{m}}\right)+0.062{\left(\frac{T}{303}\right)}^{2}{\left(\frac{I}{{A}_{m}}\right)}^{2.5}\right]}{\left[\lambda -0.634-3\left(\frac{I}{{A}_{m}}\right)\right]\cdot exp\left(4.18\left(\frac{T-303}{T}\right)\right)}$$
(10)

It’s worth affirming that \(\lambda \) refers to the water content in the membrane and its determination is a challenging issue because of its reliance on the cell-drawn current. However, a certain water content, at all possible operating conditions, is assumed unchangeable in this work.

Additionally, \({V}_{cn}\) is given by (11)34.

$${V}_{cn}=-\delta ln\left(1-\frac{I}{{A}_{m}\cdot {J}_{m}}\right)$$
(11)

where, \(\delta \) is an empirical factor in (\(V\)) and \({J}_{mx}\) is the peak current density in (\(\mathrm{A }{\mathrm{cm}}^{-2}\)).

Lastly, the stack output power \(\left({P}_{st}\right)\) can be determined by (12)36,41.

$${P}_{st}={V}_{st}\times I$$
(12)

At this moment, the reader can easily notice the seven unknown parameters are namely (\({\zeta }_{1}, {\zeta }_{2},{\zeta }_{3}, {\zeta }_{4}, \lambda , {R}_{l} and \delta \)) that are ungiven in the manufacturers’ datasheets31,32,33,34,35,36,37,39. These parameters are optimally generated using the KOA-based methodology to achieve an accurate simulation of the PEMFCs under various operating scenarios.

Cost function allocation

Herein, the summation of square deviations (SSDs) between the actually measured voltages \({V}_{ms}\) and the model-based calculated ones \({V}_{cal}\) is adopted to optimally pick the values of the seven parameters. Since the SSDs, given by (13), is vastly employed in the literature22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39, and also to make a just comparison to the already-published algorithms, the CF is assigned to minify the SSDs, as depicted in (14).

$$SSDs=\sum_{m=1}^{n}{\left[{V}_{ms}(m)-{V}_{cal}(m)\right]}^{2}$$
(13)
$$CF=Min \left(SSDs\right)$$
(14)

where, n defines the number of the measured voltage-current dataset points.

Furthermore, the SSDs is susceptible to inequality bounds where each unknown parameter has its own lower and higher limits. It’s noteworthy to indicate that the KOA preserves these limits while searching for optimal values. Utilizing the SSDs values, the main goal is to significantly fit the recorded terminal voltages to the relevant computed ones by the KOA-based methodology.

Kepler optimization algorithm

Basically, KOA is a physics-based optimizer that imitates the planets’ motion according to Kepler’s laws. Particularly, the sun and its planets (objects) moving around it in (fictitious) oval paths (orbits) are utilized to simulate the search space, which represents Kepler’s first statement. Specifically, the planets in KOA (nominated solutions) exist at various positions from the sun (optimal solution) and at different times, hence, the exploration and exploitation concepts are effectively performed, as shown in Fig. 2. There are many factors affecting the planet’s position from the optimal solution (the sun) such as the actual planet’s position, the attraction force between the sun and the planet, and its revolving speed around the sun39.

Figure 2
figure 2

KOA’s exploration and exploitation regions.

Principally, KOA starts with stochastic initialization of the objects’ numbers and positions, as represented by (15).

$${Y}_{i}^{j}={lb}_{i}^{j}+{s}_{1}\times \left({hb}_{i}^{j}-{lb}_{i}^{j}\right), \left\{\begin{array}{c}i=\mathrm{1,2},\dots ,{N}_{p}\\ j=\mathrm{1,2},\dots , d\end{array}\right.$$
(15)

where \({Y}_{i}^{j}\) denotes the \({i}^{th}\) object (nominated solution) in the search area. The population of the solution nominees in the search area is represented by \({N}_{p}\) and the number of variables to be optimized is defined by \(d\). \({lb}_{i}^{j}\) and \({hb}_{i}^{j}\) are the lower and higher boundaries of the \({j}^{th}\) decision parameter, respectively.

The initialization of the orbital deviation \({O}_{d}\) for each \({i}^{th}\) object is given by (16).

$${{O}_{d}}_{i}={s}_{2}, i=\mathrm{1,2},\dots ,{N}_{p}$$
(16)

Lastly, the orbital interval \({O}_{t}\) for each ith object is initialized by (17).

$${{O}_{t}}_{i}=\left|s\right|, i=\mathrm{1,2},\dots ,{N}_{p}$$
(17)

where \(s\) is a stochastically normal generated number.

The gravitational force \({{G}_{f}}_{i}\) that attracts any plant \({Y}_{i}\) to the sun \({Y}_{s}\) is defined by the universal gravitational law which is function of the sun and the planet mass \({m}_{s}\) and \({m}_{i}\), respectively, and length between the star and the planet \({R}_{i}\), as given by (18).

$${{G}_{f}}_{i}\left(t\right)={{O}_{d}}_{i}\times \alpha \left(t\right)\times \frac{\overline{{m }_{s}}\times \overline{{m }_{i}}}{{\overline{{R }_{i}}}^{2}+\epsilon }+{s}_{3}$$
(18)

where the global gravitational constant is symbolized by \(\alpha \) and formulated by (19), and \(\epsilon \) is a trivial number to avoid dividing by zero error. \(\overline{{R }_{i}}\) defines the normalized value of \({R}_{i}\) which is calculated by (20). The normalized values of \({m}_{s}\) and \({m}_{i}\) are represented by \(\overline{{m }_{s}}\) and \(\overline{{m }_{i}}\) and computed by (21)–(24), respectively.

$$\alpha \left(t\right)={\alpha }_{o}{.e}^{\frac{-\gamma .t}{{t}_{m}}}$$
(19)

where, \(t\) and \({t}_{m}\) are the actual iteration and the highest number of iterations. The initial value and a constant are denoted by \({\alpha }_{o}\) and \(\gamma \), respectively.

$${R}_{i}\left(t\right)={\left[\sum_{j=1}^{d}{({Y}_{s}^{j}-{Y}_{i}^{j})}^{2}\right]}^{0.5}$$
(20)
$${m}_{s}={s}_{4}\times \frac{{bst}_{s}\left(t\right)-wst(t)}{{\sum }_{k=1}^{{N}_{p}}({f}_{k}\left(t\right)-wst(t))}$$
(21)
$${m}_{i}=\frac{{bst}_{i}\left(t\right)-wst(t)}{{\sum }_{k=1}^{{N}_{p}}({f}_{k}\left(t\right)-wst(t))}$$
(22)
$${bst}_{s}\left(t\right)=\mathrm{min}\left({f}_{k}\left(t\right)\right), k\in \mathrm{1,2},\dots ,{N}_{p}$$
(23)
$$wst\left(t\right)=\mathrm{max}\left({f}_{k}\left(t\right)\right), k\in \mathrm{1,2},\dots ,{N}_{p}$$
(24)

where \({s}_{4}\) is a stochastic number generated from 0 to 1. \({f}_{k}\left(t\right)\) refers to the fitness function of the kth object.

According to Kepler’s law, the velocity of a planet is dependent on its position from the sun. In detail, if the planet is close to the sun, it will experience a strong gravitational force, and hence, it will accelerate its motion to avoid pulling into the sun and vice versa. So, the planet’s velocity is described by (25).

$${v}_{i}\left(t\right)=\left\{\begin{array}{c}\vartheta .\left(2{s}_{5}.\overrightarrow{{Y}_{i}}-\overrightarrow{{Y}_{b}}\right)+\ddot{\vartheta }.\left(\overrightarrow{{Y}_{a}}-\overrightarrow{{Y}_{b}}\right)+\left(1-{{R}_{i}}_{n}\left(t\right)\right).F.\overrightarrow{{c}_{1}}.\overrightarrow{{s}_{6}}.\left(\overrightarrow{{hb}_{i}}-\overrightarrow{{hb}_{i}}\right),\\ \begin{array}{c}{{R}_{i}}_{n}\left(t\right)\le 0.5 \\ {s}_{5}.\Psi .\left(\overrightarrow{{Y}_{a}}-\overrightarrow{{Y}_{i}}\right)+\left(1-{{R}_{i}}_{n}\left(t\right)\right).F.\overrightarrow{{c}_{2}}.\overrightarrow{{s}_{6}}.\left({s}_{7}.\overrightarrow{{hb}_{i}}-\overrightarrow{{hb}_{i}}\right), elsewhere\end{array}\end{array}\right.$$
(25)
$$\vartheta =\overrightarrow{c}\times q\times\Psi $$
(26)
$$\Psi =\sqrt{\left[\alpha \left(t\right)\times ({m}_{s}-{m}_{i})\left|\frac{2}{{R}_{i}\left(t\right)+\epsilon }-\frac{1}{{a}_{i}(t)+\epsilon }\right|\right]}$$
(27)
$$q=({s}_{7}\times \left(1-{s}_{5}\right)+{s}_{5})$$
(28)
$$\overrightarrow{c}=\left\{\begin{array}{ll}0,&\quad \overrightarrow{{s}_{6}}\le \overrightarrow{{s}_{8}}\\ 1, &\quad else\end{array}\right.$$
(29)
$$\mathcal{F}=\left\{\begin{array}{ll}1,&\quad {s}_{5}\le 0.5\\ -1,&\quad else\end{array}\right.$$
(30)
$$\ddot{\vartheta }=(1-\overrightarrow{c})\times \overrightarrow{q}\times\Psi $$
(31)
$$\overrightarrow{q}=({s}_{7}\times \left(1-\overrightarrow{{s}_{6}}\right)+\overrightarrow{{s}_{6}})$$
(32)
$$\overrightarrow{{c}_{1}}=\left\{\begin{array}{ll}0, &\quad\overrightarrow{{s}_{6}}\le \overrightarrow{{s}_{5}}\\ 1,&\quad else\end{array}\right.$$
(33)
$$\overrightarrow{{c}_{2}}=\left\{\begin{array}{ll}0,&\quad \overrightarrow{{s}_{7}}\le \overrightarrow{{s}_{5}}\\ 1,&\quad else\end{array}\right.$$
(34)
$${{R}_{i}}_{n}\left(t\right)=\frac{{R}_{i}\left(t\right)-\mathrm{min}(R(t))}{\mathrm{max}\left(R\left(t\right)\right)-\mathrm{min}(R\left(t\right))}$$
(35)

where \({a}_{i}(t)\) symbolizes a semi-main axis of the oval path of the \({i}^{th}\) planet and is given by (36).

$${a}_{i}(t)={s}_{5}\times \sqrt[3]{\left[{{{O}_{t}}_{i}}^{2}\times \frac{\alpha \left(t\right)\times ({m}_{s}+{m}_{i})}{4{\pi }^{2}}\right]}$$
(36)

Generally, most objects move around the sun in an anti-clockwise direction, nevertheless, some of them may revolve in a clockwise motion. KOA emulates this phenomenon by employing a flag \(\mathcal{F}\) to avoid trapping in the local minima zones. More specifically, KOA use \(\mathcal{F}\) to adjust the search flow so that the objects enhance their scanning ability in the search space.

The exploration phase is attained when the objects are away from the sun, referring that KOA efficiently explores the whole search space. Thence, the updated position of each planet away from the sun is described by (37).

$$\overrightarrow{{Y}_{i}}\left(t+1\right)=\overrightarrow{{Y}_{i}}\left(t\right)+\mathcal{F}\times \overrightarrow{{v}_{i}}\left(t\right)+({{G}_{f}}_{i}\left(t\right)+\left|s\right|)\times \overrightarrow{c}\times \left(\overrightarrow{{Y}_{s}}(t)-\overrightarrow{{Y}_{i}}(t)\right)$$
(37)

On the other hand, if the objects are close to the star, KOA will concentrate on optimizing the exploitation phase. The switching between the two phases is done using an adaptive controlling factor \(h\), which gradually alters as a function of the time, as revealed in (38). Thus, the new position of the planets based on this controlling strategy is formulated by (39).

$$h={\left[\mathrm{exp}(s(({a}_{2}-1)\times {s}_{5}+1))\right]}^{-1}$$
(38)
$$ \begin{gathered} \overrightarrow {{Y_{i} }} \left( {t + 1} \right) = \overrightarrow {{Y_{i} }} \left( t \right) \times \vec{c} + \left( {1 - \vec{c}} \right) \hfill \\ \times \left[ {\frac{{\overrightarrow {{Y_{i} }} \left( t \right) + \overrightarrow {{Y_{s} }} \left( t \right) + \overrightarrow {{Y_{a} }} \left( t \right)}}{3} + h \times \left( {\frac{{\overrightarrow {{Y_{i} }} \left( t \right) + \overrightarrow {{Y_{s} }} \left( t \right) + \overrightarrow {{Y_{a} }} \left( t \right)}}{3} - \overrightarrow {{Y_{b} }} \left( t \right)} \right)} \right] \hfill \\ \end{gathered} $$
(39)

where \({a}_{2}\) is a periodical regulating factor gradually decays from -1 to -2 for \(\mathcal{M}\) cycles throughout the overall optimization task, as indicated in (40).

$${a}_{2}=-1-\left(\frac{t\%\frac{{t}_{m}}{\mathcal{M}}}{\frac{{t}_{m}}{\mathcal{M}}}\right)$$
(40)

Finally, the optimum position of the objects and the sun is determined by (41).

$$\overrightarrow{{Y}_{i,new}}\left(t+1\right)=\left\{\begin{array}{ll}\overrightarrow{{Y}_{i}}\left(t+1\right),&\quad f(\overrightarrow{{Y}_{i}}\left(t+1\right))\le f(\overrightarrow{{Y}_{i}}\left(t\right))\\ \overrightarrow{{Y}_{i}}\left(t\right),&\quad elsewhere\end{array}\right.$$
(41)

where \({s}_{x} ( x=1:8\)) are stochastically generated numbers from 0 to 1.

It’s clearly noticed that the KOA has only to parameters need to be manually set, which are \({N}_{p}\) and \({t}_{m}\). As a result, lower computational burden and less independents runs are required to obtain the best performance of KOA. The overall steps of the KOA are presented, in detail, in Fig. 339.

Figure 3
figure 3

KOA’s flowchart.

Numerical simulations and algorithm verification

To appraise the robustness and the efficacy of the proposed KOA, the performance of four commercial stacks, commonly studied in the state-of-art, are assessed under different steady-state circumstances. In addition, the unknown parameters' limits have been extracted from the literature and maintained unchanged over all the test cases, to guarantee fair judgment to all the competitive algorithms. Moreover, all of the numerical simulations are carried out on a computer with an Intel Core i7 CPU and 8 GB of RAM using the MATLAB platform, version R2022a. The operating system is Windows 10 Enterprise.

It's worth asserting that the values of the KOA controlling parameters \({N}_{p}\) and \({t}_{m}\) are 10 and 10,000, respectively. Furthermore, the best values of unspecified parameters are picked after executing KOA over 20 independent runs due to the high randomness of MOAs. At the end, the statistical performance of KOA is checked to prove its robustness.

Test cases’ datasheets and the parameters’ boundaries

The reader is invited to browse Table 1 for the technical specifications of the four earlier-announced test cases, which are extracted from25,27,28,29,30. The relative humidity’s of the vapor at anode and cathode \({RH}_{a}\) and \({RH}_{c}\) are maintained at 1.00 in all cases. Also, Table 1 (last three columns) reveals the minimum and maximum operating boundaries of the undefined parameters, as obtained from34,36,37,42.

Table 1 Technical specs of the test cases and practical limits of the undefined parameters.

KOA-based parameters’ estimation outcomes

At this moment, KOA besides, two recent and two well-matured optimizers, are employed to efficiently determine the seven ungiven parameters of Amphlett’s model. Actually, the driving training-based algorithm (DTBA)43 and the election-based optimization algorithm (EBOA)44 are the two new algorithms, while grey wolf algorithm (GWA) and particle swarm algorithm (PSA) represent the two benchmark algorithms. Practically, Tables 2, 3, 4 and 5 elucidate the KOA-based minimum SSD’s values, for the four aforementioned test cases after 20 autonomous runs, compared to the four executed algorithms and the other recently-reported optimizers. Examples are improved artificial hummingbird algorithm (IAHA)45, honey badger algorithm (HBA)46, manta rays foraging algorithm (MRFA)47, pathfinder algorithm (PFA)48, neural network algorithm (NNA)49, and moth-flame algorithm (MFA)50. Besides, sparrow search algorithm (SSA)51, vortex search algorithm (VSA)52, modified monarch butterfly algorithm (MMBA)53, quasi oppositional bonobo algorithm (QOBA)54, modified farmland fertility algorithm (MFFA)55, marine predator algorithm (MPA)56, modified AEA (MAEA)57, satin bowerbird algorithm (SBA)58, and shark smell optimizer (SSO)59 are also brought to comparison with the proposed KOA-based results. Over and above, the optimal values of the unknown parameters for each algorithm are also captured in the above-stated tables. Furthermore, the convergence trends of the applied optimizers for the four PEMFCs’ stacks are revealed in Fig. 4a–d.

Table 2 KOA outcomes compared to other competitive optimizers for Ballard Mark V.
Table 3 KOA outcomes compared to other competitive optimizers for BCS 0.5 kW.
Table 4 KOA outcomes compared to other competitive optimizers for NedStack PS6.
Table 5 KOA outcomes compared to other competitive optimizers for Temasek 1 kW.
Figure 4
figure 4

SSD convergence patterns for the test cases.

The observation we may mention about KOA achieving excellent results for the studied applications but being hampered by a slight delay in convergence (required high iteration) is indeed an important limitation compared to those published in the literature. Convergence refers to the point at which an algorithm’s performance stabilizes, indicating that it has learned the underlying patterns in the data.

A delay in convergence can impact the efficiency and effectiveness of an algorithm, particularly in real-time or time-sensitive applications where prompt decision-making is crucial. However, it’s worth noting that convergence speed can vary depending on the complexity of the problem, the size of the dataset, and the specific algorithm being used.

It may be affirmed from the convergence patterns that KOA outperforms the other candidates in terms of escaping from getting trapped in local minima while maintaining the fastest rate to reach the best SSD throughout 10,000 iterations. Accordingly, the polarization (V–I) curves of the actually recorded and the KOA, GWA, PSA, DTBA, and EBOA-based simulated datasets for the four commercial PEMFCs’ stacks are captured in Fig. 5a–d. A closer look at Fig. 5a–d, it can be caught that the computed V–I curves, generated after injecting the optimal values of the parameters to the model, are consistent and well-fitted to the relevant experimental values. Furthermore, the minor SSD’s values support the afore-said statements (see Tables 2, 3, 4, 5).

Figure 5
figure 5

V–I curves for the four test cases.

Another form of KOA verification is the percentage terminal voltage error \({V}_{\%TE}\), which is determined to appraise how reliable and accurate the KOA is to fit the model-based calculated terminal voltages to the experimental ones, as described by (42)36,46. Figure 6a–d elucidates the changeability of \({V}_{\%TE}\) along with the relevant stack drawn current for the four benchmark test cases. It’s worth spotlighting that the highest values of \({V}_{\%TD}\) for Ballard Mark, BCS 0.5 kW, NedStack PS6, and Temasek 1 kW are 2.7017%, 0.4853%, − 1.3292%, − 3.9871%, respectively.

Figure 6
figure 6

Percentage voltage error curves.

$${V}_{\%TE}=\frac{{V}_{ms}-{V}_{cal}}{{V}_{ms}}\times 100$$
(42)

Now, after validating the proposed KOA-based methodology, it’s time to utilize its outcomes to study the impact of the polarization losses on the PEMFCs’ voltage profile. As previously discussed, the terminal voltage of the PEMFCs’ stack is influenced by three voltage drops; activation, ohmic, and concentration losses54,57. In this regard, Fig. 7a–d reveal the alternation of every single polarization loss besides, the total losses \({V}_{TL}\) as functions of the stack drawn current, for all test cases. It can be concluded from Fig. 7a–d that when starting the PEMFCs at light load, the activation losses rapidly increase, then at intermediate loading values, it almost gets saturated, while the ohmic losses start a linear rise. At heavy drawn currents, the concentration losses considerably arise.

Figure 7
figure 7

Plots of polarization losses for the test cases.

KOA-based outcomes under various operating conditions

In this subsection, after accrediting the KOA-based results, the effect of varying the PEMFCs’ operating factors, \({P}_{O}/{P}_{H}\) and \(T\), on the polarization characteristics (V–I and P–I curves) can be adequately evaluated. Particularly, only two test cases are addressed for this purpose to avoid a lengthy article. More specifically, The P–I and V–I curves of BCS 0.5 kW and NedStack 6 kW under changing the temperature (40, 60, and 80 °C), while maintaining the other factors constant, are caught in Figs. 8a,b and 9a,b, respectively. Moreover, Fig. 8c,d illustrates the impact of adjusting the suppliant partial pressures (\({P}_{O}/{P}_{H}\) = 0.2095/1, 1/1.5, 1.5/2.5 bar) on the aforementioned curves of BCS 0.5 kW, while unchanging the other datasheet’ factors. The same is done for NedStack 6 kW, the V–I and P–I curves are generated while varying the input partial pressures (\({P}_{O}/{P}_{H}\) = 1/1, 1.5/2, 2/3 bar), as revealed in Fig. 9c,d25,36.

Figure 8
figure 8

V–I and P–I curves of BCS 0.5 kW under various operating conditions.

Figure 9
figure 9

V–I and P–I curves of NedStack 6 kW under various operating conditions.

It goes without saying that according to Figs. 8 and 9, increasing the operating factors of the PEMFCs, whether \({P}_{O}/{P}_{H}\) or \(T\), positively affects the stack output voltage and power at the same drawn current. However, any increase over the nominal limits stated by the manufacturer will lead to severe degeneration of PEMFC’s performance.

KOA’s statistical performance evaluation

Here, several statistical indices are generated to examine the computational performance of the proposed KOA. Mainly, the min, the max, the mean, and the standard deviation (StD) of the SSD are calculated after 20 independent runs for all the implemented algorithms. Hence, Table 6 depicts the values of those statistical parameters of KOA, GWA, PSA, DTBA, and EBOA for the four illustrated test cases. Since the parameters’ estimation of PEMFC is an offline task, which means that the parameters shall be determined before operating the PEMFC, it’s insignificant to consider the algorithms’ computational time. Nevertheless, according to Table 6 (last column), KOA extremely outperforms the other competitors in terms of the computational burden.

Table 6 Statistical indices of KOA and others.

Table 6 indicates that KOA outperforms the other implemented optimizers in terms of statistical performance. All the afore-announced results appraise how efficient, robust, and fast the KOA-based methodology is to tackle the parameters’ determination problem of Amphlett’s well-known steady-state model. This motivates the authors to examine these outcomes on the dynamic response of the PEMFCs, as illustrated in the next section.

In addition, a further analysis to indicate the time complexity of the implemented algorithms using Big O(…) is performed. In which, the time complexities of the KOA, GWA, PSA, DTBO and EBOA algorithms can be expressed as O(N.Tmax), O(N.Tmax.f), O(N.Tmax.f), O(N.m.(1 + 3Tmax)), and O(N.m.(1 + 2Tmax)), respectively. N is the population size, Tmax is the number of iterations, m is the number of problem variables, and f represents the time complexity of evaluating the objective function for a single particle. The above mentioned justified that why the elapsed time for processing of KOA is lesser than others as indicated in Table 6.

Regarding the computational cost, it’s true that some metaheuristic algorithms can be computationally expensive, the actual computational cost depends on various factors such as problem size, convergence criteria, and implementation efficiency. It is important to evaluate the trade-off between computational cost and the quality of the obtained solution as indicated above. Bear in mind that the task of PEMFC’s parameters estimation is off-line in nature.

Dynamic assessment of PEMFCs stack

In this context, the simplified dynamic performance of the PEMFCs stack is evaluated from the electrical perspective. Since the time constant of the PEMFC chemical reactions is almost 10–19 s, the electrochemical response can be neglected. Besides, the polarization losses are assumed uninfluenced by the PEMFC’s load dynamics, except for the activation losses. Thence, the mathematical representation of the dynamic activation voltage drop \({V}_{ac}(t)\) is given by (43)23,57.

$${V}_{ac}(t)={V}_{ac}(see \left(7\right))\times \frac{1}{{t}_{d}.{e}^{\frac{-t}{{t}_{d}}}+1}$$
(43)

where, the time constant of the activation over-potential reaction is symbolized by \({t}_{d}\).

It’s worth stating that this simplified version of Amphlett’s model doesn’t consider the time constants of the balance-of-plant devices, like the hydrogen and oxygen compressors24,60,61,62. Based on the above hypotheses, a simplified dynamic model is constructed via SIMULINK environment to simulate the PEMFC’s electrical performance due to load variations, as shown in Fig. 10.

Figure 10
figure 10

Block diagram of the simplified dynamic model.

As a representative of the other test cases, NedStack 6 kW stack is employed to check the validity of the proposed dynamic model, where \({t}_{d}\) equals 1.2 s and the other datasheet’s parameters are kept at their nominal values (see Table 1 (fourth column)). Specifically, a step variation of the stack drawn current, whose values are equal to 9 A, 171 A, 45 A at 0 s, 40 s, and 70 s, respectively, is applied to the proposed model, as cropped in Fig. 11a. The dynamic model simultaneously responds to this variation, as revealed in Fig. 11b,c.

Figure 11
figure 11

Dynamic behavior of NedStack PS6 due to sudden load variations.

More specifically, the stack terminal voltage values due to these changes are captured in Fig. 11b, which totally fit to the simulated steady-state values indicated in Fig. 5c. Furthermore, the behaviors of the internal polarization losses due to the afore variation are depicted in Fig. 11c. It’s noteworthy to recall what is stated before, as the load current increases, the stack polarization losses also increase, and accordingly its terminal voltage reduces until reaches a steady-state value as plotted in Fig. 5c. Now, it comes without any doubt that the simplified model based on the KOA’s results can effectively and acceptably simulate the electrical dynamic response of the PEMFCs.

Conclusion and future prospective

A viable and effective methodology based on KOA has been introduced for optimally specifying the undefined parameters of the commonly investigated PEMFC’s model, called Amphlett’s model. Four practical study cases of well-known commercial PEMFCs’ types have been comprehensively discussed through a set of simulated electrical characteristics such as the calculated V–I and P–I curves and the polarization losses alternation with the drawn currents. In addition to that it’s worth mentioning that the percentage terminal voltage error between the KOA-based computed voltages and the experimentally recorded ones are 2.7%, 0.49%, − 1.33%, − 3.99% for Ballard Mark V, BCS 0.5 kW, NedStack PS6, and Temasek 1 kW PEMFCs, respectively. Furthermore, the effect of varying the input operating factors of the PEMFCs, like the temperature and the suppliant pressures, is deeply assessed for the whole test cases. Statistically, KOA robustness and preciseness have been validated through multiple indices like StD, min, max, mean, and computational CPU time, where it extremely outperforms the other challenging competitors. Moreover, the electrical dynamic performance of the PEMFCs is brought under study using an upgraded version of Amphlett’s model. This work still needs to be expanded in order to accurately analyze the performance of PEMFCs stack due to actual disturbances and other operating parameters like the hydrogen and oxygen flow rates. Additionally, the electrical behavior of the PEMFCs stacks when operating in parallel is taken into account in the anticipated future work. Once again, the promising results of the KOA encourage the research community to extend this current to study the performance of such PEMFCs stacks with maximum power tracker in real conditions and to study their behaviors' when they are connected to microgrid.