Introduction

Fossil fuels and traditional energy sources use have drastically increased with such pace in their reliance that has increased greenhouse emissions and further deteriorated the environmental issues. However, these effects do more than just threaten ecosystems, human health, and societal sustainability. Therefore, renewable energy sources (RESs) are considered as important alternatives for dealing with these challenges. Fuel cells (FCs) are among the promising RESs for the generation of heat and electricity with minimal environmental impact. In particular, Proton Exchange Membrane Fuel Cells (PEMFCs) are of interest because of their simple structure, high energy density, and adaptability to applications such as residential power, transportation, and energy storage.

Although promising, accurately modeling and optimizing PEMFCs is a difficult task. Due to the nonlinear and complex operational nature of PEMFCs, accurate mathematical models are required to predict their performance under different conditions. Empirical and quasi empirical models have successfully simulated PEMFC behaviors, but their reliability is constrained to the accuracy of parameter identification. These parameters are often unknown, and non-linear, and determining them is critical for building effective equivalent circuit models that accurately replicate real world PEMFC performance.

Previous research work

A great deal of research effort has been expended in the attempt to develop robust PEMFC parameter identification methodologies. Notable contributions include: To extract optimal parameters for PEMFC systems, Abd Elaziz et al. proposed the Gorilla Troops Optimizer (GTO), which demonstrated faster convergence rates and accuracy, but the method required specific parameter settings to be effective1. Fuzzy logic based reasoning techniques for PEMFC control were explored by Agila et al.2 that provide adaptability, but no detailed comparison with other advanced optimization methods is presented. Grasshopper Optimization Algorithms for PEMFC parameter optimization were introduced by Ai et al.3, but computational efficiency was highlighted while scalability was not tested. Finite element analysis was combined with neural networks to optimize PEMFC performance, achieving significant efficiency improvements, but the approach was complex4. To reduce computational burdens in PEMFC modeling, Ali et al. proposed an adaptive estimation method that provides accurate results, but with limited validation against real world data5. Altun et al. combined evolutionary strategies with a hybrid approach for PEMFC loss minimization and demonstrated promising results, but did not test robustness under different conditions6. Optimization strategies for Solid Oxide Fuel Cells (SOFCs) were reviewed by Anuar et al.7, comparing their high temperature application advantages with PEMFC limitations, but without focusing on PEMFC specific optimization. Awad and El-Desouky used hybrid algorithms to improve PEMFC performance by focusing on convergence speed and with limited application to various case studies8. The study lacked focus on optimization techniques, but Barbir noted technological advances in PEMFC systems in the area of energy density and durability9. In10, Chen et al. extracted PEMFC parameters using Differential Evolution algorithms with high precision, but without comparison with other algorithms.

Chen et al. highlighted challenges in computational modeling for PEMFCs, and proposed solutions to balance accuracy and efficiency, but without practical validation11. Hybrid algorithms for fuel cell optimization were introduced by Cheng et al., which achieved robust parameter tuning at the cost of high computational cost12. Adaptive learning techniques for PEMFC modeling were proposed by Ding et al.13 to reduce prediction errors, but the operational adaptability is limited. Metaheuristic global optimization methods for PEMFC design were reviewed by El-Bashir et al.14 and their potential was recognized, however, detailed implementation examples were not given. Deep reinforcement learning was applied by Fan et al. to PEMFC operational parameter optimization, which resulted in increased efficiency but limited by computational resources15. Multi objective evolutionary algorithms were used by Feng et al. to optimize PEMFC operating conditions to balance efficiency and durability, but without scalability tests16. Intelligent algorithms were used by Gao et al. to improve PEMFC stack performance, with gains in energy efficiency, but without experimental validation17. Analytical models for hybrid applications with PEMFCs were developed by Ghaffar et al., to address integration challenges, but with limited modeling of complex scenarios18. A comparative study of metaheuristics for PEMFC optimization was performed by Guo et al., who pointed out the strengths of the algorithms, but did not include real world case studies19. In20, Hafez et al. used nature inspired algorithms to enhance PEMFC performance, but without consideration of computational efficiency.

Hybrid models for PEMFC design were evaluated by Hamid et al.21 using deterministic and stochastic methods combined effectively, but the study was limited by the availability of limited datasets. Deep learning methods for multi-variable optimization of PEMFCs were introduced by He et al.22 with high accuracy but unexplored scalability. In23, Hu et al. used genetic algorithms for PEMFC parameter optimization, with nonlinear constraints but without thorough comparative analysis. Machine learning was combined with hybrid strategies to tackle PEMFC trade-offs, however, operational tests were not performed24. Adaptive neuro fuzzy systems were used by Jang et al. for PEMFC optimization25 and showed adaptability but did not include cost analysis. However, the validation of hybrid swarm algorithms across different system scales was missing, which Jiang et al. applied to balance efficiency and computational time in PEMFCs26. Multi objective optimization strategies for PEMFC stacks, including robustness metrics but not scalability issues, were proposed by Jin et al.27. Hybrid machine learning models for PEMFC efficiency were used by Karim et al.28 to improve accuracy but only offer minimal sensitivity analysis. Various optimization algorithms for PEMFC systems were compared by Khan et al.29, who focused on algorithm refinements for better scalability. Reinforcement learning was applied to PEMFC operational parameters by Kim et al.30, achieving adaptability with high computational costs.

Deep learning approaches for PEMFC diagnostics were developed by Kumar et al.31, reducing errors, but they lack robustness in real time applications. Machine learning frameworks to optimize PEMFC performance were introduced by Lei et al.32 but without practical validation, which showed gains in accuracy. Algorithmic improvements for PEMFC optimization were proposed by Li et al.33, which converge better without exploring multiobjective optimization. AI enhanced methodologies for PEMFC optimization were used by Liang et al.34 to enhance efficiency without practical validation. Liu et al. integrated neural networks into PEMFC modeling, obtaining predictive accuracy but without adaptability to dynamic conditions35. Hybrid swarm algorithms were applied to PEMFC design by Liu et al.36, but efficiency was improved without testing scalability. Loss reduction in PEMFCs using optimization techniques was focused on by Ma et al.37, but results were positive and without comparative analysis. Evolutionary algorithms for enhancing PEMFC efficiency were proposed by Malik et al.38, which have high computational cost but stability. Deep learning models developed by Mao et al.39 were applied to optimize PEMFCs with high accuracy, but at a high complexity. Hybrid optimization strategies for PEMFCs were introduced by Meng et al.40, which attempt to balance efficiency and durability, but the validation was limited.

AI models were applied to PEMFC design by Nair et al. to improve energy management, but the work was based on many theoretical assumptions41. Advanced optimization algorithms for PEMFC performance are analyzed by Nawaz et al.42, which yielded robustness but no experimental case studies. Heuristic approaches for multi-objective optimization were introduced by Nguyen et al.43 that increased cost effectiveness but with only limited scalability tests. Reinforcement learning was used by Pan et al. to improve PEMFC efficiency, which is flexible but computationally intensive44. Neuro fuzzy systems were used by Park et al. for PEMFC modeling, which are adaptable but are not validated in the real world45. Genetic algorithms are applied by Qi et al. for PEMFC optimization with improved performance but without comparison with other methods46. In47, Qian et al. developed AI driven models for PEMFC efficiency, which showed robust predictions but low scalability. Hybrid optimization techniques were used by Riaz et al. for PEMFCs, reducing computational time but with a small dataset48. Bayesian models for PEMFC optimization were explored by Rui et al.49, which improved accuracy but restricted their applicability. Multi-objective optimization strategies for fuel cells were introduced by Singh et al.50 which were robust but not validated under dynamic conditions.

Evolutionary algorithms were applied by Tang et al. for PEMFC stack design that yielded improvements in energy efficiency and operational stability. The work showed the promise of evolutionary algorithms to optimize stack performance, but was restricted in its applicability to more general operational conditions and large scale systems51. Wang et al. used hybrid machine learning techniques to optimize PEMFC efficiency, which they point out can provide a balance of accuracy and robustness. The study, though, was not able to provide insights into the computational overhead of these machine learning models52. Wang et al. also studied the application of deep learning algorithms for PEMFC optimization, demonstrating their capability of improving system efficiency and parameter estimation precision. However, it was noted as a limitation that these algorithms have a high computational cost53.

AI driven optimization frameworks for PEMFC systems were introduced by Wu et al. to enhance energy efficiency and operational adaptability. The study revealed the versatility of AI models, but did not have experimental validation to prove their real world effectiveness54. To improve performance and reliability, Xie et al. proposed the integration of advanced AI techniques into PEMFC design. However, they did not address how their model would adapt to dynamic environmental conditions, thereby limiting broader applicability55 and they were able to achieve improved parameter estimation accuracy. Hybrid algorithms for multi objective optimization in PEMFC systems were presented by Xu et al. that effectively trade off efficiency and durability. However, these algorithms are computationally demanding and it became a challenge to scale them56.

A comparison of the AI models used was made by Yang et al. for their contribution to PEMFC optimization, and they demonstrated great improvements to the energy efficiency and robustness. The study provided valuable insights, but testing in dynamic and real world conditions was not performed, which limited its practical applicability57. To estimate PEMFC parameters, Zhang et al. used advanced deep learning models for PEMFC design optimization with high accuracy. However, the study did not provide a detailed comparison with other optimization frameworks58 and showed the potential of AI to enhance the PEMFC performance. Zhang et al. also investigated hybrid models for PEMFC systems to optimize the PEMFC system, and showed improvements in both operational stability and energy efficiency. The study, however, was limited in scalability to diverse conditions59. Lastly, Zhou et al. proposed novel multi objective optimization approaches for PEMFC systems with the aim of improving their operational flexibility and efficiency. The approach was promising but its overall impact was reduced because of the absence of a thorough comparison with state of the art methods60.

Research gap

Literature of recent work of last half decade shows a consistent focus on improving PEMFC efficiency through optimization algorithms but gaps exist in scalability, adaptability to dynamic conditions, computational efficiency and real world validation. However, most existing studies focus on single objective or limited multi objective optimization, without addressing the complex tradeoffs between cost, durability and performance in a comprehensive way. The importance of this is that a novel, hybrid algorithm that combines the best of advanced AI and metaheuristic strategies is needed to provide scalable, efficient, and robust solutions to PEMFC optimization problems. The main challenge in PEMFC modeling is to determine the optimal values of critical parameters so that the estimated performance becomes consistent with experimental data. However, current optimization methods are often computationally expensive and variable, rendering them unsuitable for real time applications or large scale systems. As a result, there is a strong need to develop a robust optimization algorithm that guarantees accuracy and consistency while minimizing computational overhead.

The main difficulty in PEMFC modeling is finding the optimal values of critical parameters to make the estimated performance converge with the experimental data. However, current optimization methods are computationally expensive and variable, and are thus not suitable for real time applications or large scale systems. Therefore, there is a compelling need to develop a robust optimization algorithm that is both accurate and consistent, and that minimizes computational overhead.

Contributions of this work

To address these challenges, this paper presents a novel hybrid optimization algorithm, a particle swarm optimization for mixed mutant slime mold (SCPSO)61, specifically designed for PEMFC parameter optimization. The paper introduces SCPSO as a hybrid optimization method that combines PSO with Mixed Mutant Slime Mold to optimize PEMFC parameters while improving precision and computational speed and reliability. The paper demonstrates SCPSO’s importance through an evaluation of different optimization algorithms from the introduction section that shows their strengths and weaknesses. Gorilla Troops Optimizer (GTO) demonstrates quick parameter extraction accuracy for PEMFC systems yet requires fixed parameter configurations which reduces its flexibility for different system configurations. The adaptability of fuzzy logic methods in dynamic control systems exists without any state-of-the-art optimization method performance comparisons. The computational efficiency of the Grasshopper Optimization Algorithm exists alongside unproven testing of its scalability potential for bigger PEMFC systems. Real-time application feasibility may suffer from the combined approach of Finite Element Analysis together with Neural Networks because the method introduces complex operational requirements. The Adaptive Estimation Method delivers accurate PEMFC models at low computational expense yet its implementation depends heavily on real-world testing because real-world testing affects practical operation and safety. Hybrid approaches that utilize evolutionary strategies present effective loss reduction performance but need further assessment of their operational condition adaptability. The precision of Differential Evolution parameter extraction remains high but its validation becomes challenging because of lacking comparative studies with alternative methods. The computation-intensive nature of hybrid algorithms as parameter optimizers restricts their capacity for real-time PEMFC system operation even when they enhance the robustness of parameter settings. The implementation of adaptive learning strategies in PEMFC modeling leads to major reduction of prediction errors but they demonstrate limited capability for dynamic operating conditions. The potential of metaheuristic methods for PEMFC design remains unclear because their detailed implementation remains unclear which prevents their practical use. The enhanced efficiency from deep reinforcement learning requires huge computational resources making its scalable application restricted. The implementation of multi-objective evolutionary algorithms for PEMFC operation finds balance between efficiency and durability but needs extensive scaling tests before application in larger systems. The contribution of intelligent algorithms to stack performance improvement and energy efficiency remains unproven experimentally which reduces their reliability when used in real-world applications. The analytical models that address hybrid application integration issues show restricted application in complex scenarios because of their basic modeling capabilities. The comparison of metaheuristic algorithms demonstrates distinct features between optimization techniques although it does not contain actual industry applications for practical use. The implementation of PEMFC technology through nature-inspired algorithms utilizing biologically based methodologies requires more thorough evaluation of computational speed to ensure practical implementation success. The combination of deterministic and stochastic approaches in modeling helps improve PEMFC design only through constrained access to datasets. The application scope of deep learning optimizations for PEMFCs may be limited in large-scale systems because high-accuracy multi-variable optimization is achieved while scalability tests have not been conducted. The nonlinear constraints which genetic algorithms optimize in PEMFC parameter settings need further evaluation against other optimization algorithms. Machine learning models working with hybrid optimization strategies succeed at solving trade-off difficulties but need operational assessments for real-world validation. The adaptive neuro-fuzzy systems provide PEMFC optimization with adaptable features yet they lack cost evaluation which reduces their practical implementation potential. Hybrid swarm algorithms both maximize system speed and performance yet have not been tested for various-scale system implementations. The addition of robustness metrics through stack optimization under multi-objective optimization techniques does not resolve scalability issues when working with larger systems. The accuracy of PEMFC efficiency optimization with mixed machine learning models is boosted but these methods need improvement in sensitivity analysis for reliability enhancement. The operational parameter optimization benefits from reinforcement learning although its high computational expenses limit its practical use. The use of deep learning for PEMFC diagnostics decreases diagnostic errors but the solutions prove inadequate for real-time usage. Means to enhance PEMFC performance through machine learning frameworks need extra practical testing before final acceptance. Better PEMFC optimization results from algorithmic advancements in convergence capabilities although these changes do not develop or explore multi-objective optimization potential. The effectiveness of AI-enhanced methodologies grows through efficiency improvements yet their experimental verification is nonexistent which holds negative impacts on reliability. The predictive power of PEMFC modeling improves through neural networks despite the need to investigate their capacity to adjust when dynamic conditions occur. The use of hybrid swarm algorithms enhances PEMFC design efficiency but developers need to verify system scalability aspects. The positive results from loss reduction optimization methods exist without established comparisons to alternative solutions. The computational stability and efficiency of evolutionary algorithms might be limited by high computational needs that affect their practicality potential. The implementation of deep learning models improves both system operating efficiency and parameter estimation accuracy at the cost of increased computational complexity. Hybrid optimization strategies bring together an optimal balance between operational life and performance efficiency while their limited validation requirements reduce reliability measures. The AI-based energy management techniques improve power usage through theoretical framework assumptions which restrict their effectiveness in actual practice. The effectiveness of advanced optimization algorithms in performance optimization remains unknown because experimental case studies have not validated their results. The heuristic optimization methods reduce PEMFC optimization costs while needing further scalability testing. The operational adaptability of AI-driven optimization frameworks improves through their frameworks yet does not have tested validation in real-world applications. AI applications deliver superior parameter estimation results yet they do not solve the issue of PEMFC performance change during environmental system fluctuations. Hybrid systems made from deterministic and stochastic methods work effectively for PEMFC designs despite existing limitations in their usable datasets. The extensive review of these optimization methods reveals both their positive and negative aspects for PEMFC optimization. The SCPSO algorithm uses PSO and Mixed Mutant Slime Mold benefits to overcome optimization challenges while improving accuracy and efficiency and achieving consistent results. The computational and adaptability challenges of existing methods find improvement through SCPSO which demonstrates potential as a solution for PEMFC parameter optimization.

The SCPSO algorithm reaches exceptional performance because it combines Particle Swarm Optimization (PSO) and Mixed Mutant Slime Mold Algorithm (SMA) features into a single hybrid structure. The combined structure produces superior exploration and exploitation capabilities that create a balanced optimization process. The combination of PSO global capability with SMA efficient localized search in SCPSO allows the method to avoid premature convergence and find the global optimum efficiently. The algorithm combines two mechanisms which allow it to search multiple areas of the optimization space while building a robust path toward finding optimal solutions. The improved population initialization strategy serves as a main efficiency factor for SCPSO. The algorithm uses Good Point Set methodology to achieve uniform distribution of its initial solutions. The strategy creates more diverse search space conditions that enable complete exploration of available solutions. The risk of suboptimal initial distributions becomes minimized through SCPSO which leads to better chances of discovering superior parameter values. The system implements adaptive parameter adjustments through which both control weights and learning constants automatically modify their values according to optimization status. By being adaptable the algorithm preserves a balanced relationship between exploration and exploitation from start to end of the search procedure resulting in rapid and precise convergence. The SCPSO algorithm includes a mutation mechanism which draws its concept from SMA. The structured randomness function adds unpredictable variability to the search operations which helps the system escape current local optima while exploring new search areas which normal optimization methods would overlook. SCPSO implements a sigmoid function for nonlinear scaling that expands the search area and enhances its ability to solve complex optimization problems with multiple optimal solutions. The optimization process becomes more efficient through dynamic adjustments of step size and search direction in SCPSO. The combination of reliability and stable performance of SCPSO sets it apart from competing algorithms. The hybrid framework within this method produces consistent outcomes across multiple runs because standard deviation measurements for SSE values remain low. This makes SCPSO an excellent choice for practical usage because it delivers dependable solutions in critical scenarios requiring precise results. The receipt of specialized features enables the algorithm to surpass current optimization techniques both in terms of precision accuracy and fast convergence speed and overall stability. The SCPSO approach proves itself as an optimal and efficient method for PEMFC parameter optimization by addressing the issues found in traditional metaheuristic techniques.

The key contributions of this research are:

  • Proposed Algorithm: SCPSO integrates the exploration capabilities of Particle Swarm Optimization (PSO) with the exploitation features of Mixed Mutant Slime Mold to enhance convergence speed and solution accuracy.

  • Extensive Comparisons: The algorithm is benchmarked against seven state-of-the-art algorithms, including Fick’s Law Algorithm (FLA)62, Hybrid Firefly and PSO (HFPSO)63, Particle Swarm Optimization with Learning Strategy (PSOLC)64, Equilibrium Slime Mold Algorithm (ESMA)65, and LSMA66, DETDO67, and EGJO68.

  • Comprehensive Evaluation: The proposed approach is applied to six commercial PEMFCs (BCS 500 W69,70, SR-12 500 W69,70, STD 250 W69,70, Nedstack 600 W PS671, Horizon H-1272, and Ballard Mark V72) to validate its effectiveness in minimizing SSE, with comparisons based on statistical metrics such as Mean SSE, Standard Deviation (STD), and computational runtime.

  • Real-World Validation: Experimental datasets are used to evaluate the algorithm’s ability to predict polarization curves, voltage outputs, and power generation with high precision.

  • Statistical Robustness: Multiple statistical tests, including Friedman Ranking and Wilcoxon Signed-Rank tests, are conducted to confirm the superiority and consistency of SCPSO over competing methods.

The novelty of this work is to hybridize PSO and Slime Mold principles to construct a balanced framework for robust PEMFC parameter optimization. The SCPSO algorithm offers a dual advantage: There was an enhanced computational efficiency and superior accuracy. It is a reliable tool for real world applications due to its ability to maintain low SSE with minimal variability across multiple runs. PEMFCs represent an advanced technology for clean energy conversion because they deliver high efficiency with minimal environmental consequences. PEMFC models rely on accurate parameter estimation because it determines their operational performance and reliability characteristics. Modern meta-heuristic algorithms together with statistical procedures have greatly optimized the processes which extract parameters. The authors Kanouni and Laib73 developed an enhanced Differential Evolution algorithm which successfully optimized PEMFC performance by accurately extracting model parameters. Saad et al.74 developed a parameter estimation technique that employs the Huber loss statistical function for enhancing estimation accuracy during noise disturbances. Jangir and his co-authors created a PEMFC parameter estimation technique based on Differential Evolution with depth information enhancement to reach high precision results75. Computational methods play a vital role in advancing PEMFC technology because various studies show their critical value for innovation in this field.

The remainder of this paper is structured as follows: In Section "PEMFC mathematical modelling", PEMFC mathematical modeling and the optimization problem formulation are presented. In Section "Particle swarm optimization algorithm for hybrid mutant slime mold", the design and operational principles of the SCPSO algorithm are detailed. The experimental setup, simulation results, and comparative analyses are presented in Section "Result analysis and discussion". Section "Conclusions" concludes with a key findings and potential future directions.

PEMFC mathematical modelling

Basic concept of PEMFC

The Proton Exchange Membrane Fuel Cell (PEMFC) structure includes two electrodes, specifically the anode and the cathode, and a proton-conducting membrane positioned between these electrodes as the polymer electrolyte. The schematic diagram of fuel cell is given in Fig. 1.

Fig. 1
figure 1

Schematic of fuell cell.

This arrangement permits the passage of protons while restricting electron flow76. Additionally, catalyst layers are placed between the electrolyte membrane and both electrodes to expedite the chemical reaction. Hydrogen gas is supplied to the anode electrode, where, upon reaching the catalytic layer, it dissociates into electrons and protons. The protons then migrate through the electrolyte membrane to the catalytic layer at the cathode electrode, while the electrons are conducted through an external load. Oxygen or air is supplied to the cathode, and upon arrival at the catalytic layer of the cathode electrode, it combines with the protons from the membrane and the electrons from the external circuit to produce water. The electrochemical reactions at the PEMFC electrodes are expressed as follows76:

Anode reaction

$$\begin{array}{c}{H}_{2}\to 2{H}^{+}+2{e}^{-}\end{array}$$
(1)

Cathode reaction

$$\begin{array}{c}2{H}^{+}+\frac{1}{2}{O}_{2}\to {H}_{2}O\end{array}$$
(2)

Overall reaction:

$$\begin{array}{c}{H}_{2}+\frac{1}{2}{O}_{2}\to {H}_{2}O+{\text{E}}{\text{n}}{\text{e}}{\text{r}}{\text{g}}{\text{y}}+{\text{H}}{\text{e}}{\text{a}}{\text{t}}\end{array}$$
(3)

In Eq. (3), the term “Energy” represents the electrical energy generated as a result of electron flow from hydrogen gas traveling from the anode to the cathode through an external load. The equivalent electrical circuit for PEMFC stack is shown in Fig. 2.

Fig. 2
figure 2

Equivalent electrical circuit for PEMFC.

Mathematical model of PEMFC stacks

The output voltage \({V}_{\text{cell}}\) of each individual fuel cell can be computed using the following expression77,78:

$$\begin{array}{c}{V}_{\text{cell}}={E}_{\text{nerst}}-\Delta {V}_{\text{act}}-\Delta {V}_{\text{ohm}}-\Delta {V}_{\text{con}}\end{array}$$
(4)

In this equation, \({E}_{\text{nerst}}\) denotes the open-circuit voltage of the cell, \(\Delta {V}_{\text{act}}\) represents the activation overpotential per cell, \(\Delta {V}_{\text{ohm}}\) describes the voltage drop caused by ohmic resistance due to electron conduction through the external load and the proton movement resistance in the electrolyte membrane, and \(\Delta {V}_{\text{con}}\) indicates the concentration overpotential per cell. Amphlett et al.79 proposed a model of a fuel cell’s electrochemical properties. When a series connection of \({N}_{\text{cells}}\) identical fuel cells is configured for increased voltage output, the total stack voltage can be determined as:

$$\begin{array}{c}{V}_{\text{stack}}={N}_{\text{cells}}\cdot {V}_{\text{cell}}\end{array}$$
(5)

Here, \({N}_{\text{cells}}\) refers to the number of cells connected in series, and \({V}_{\text{cell}}\) is the output voltage for each individual fuel cell, as derived from Eq. (4).

The reversible potential, \({E}_{\text{nerst}}\), is calculated as follows80,81:

$$\begin{array}{c}{E}_{nerst}=1.229-8.5\times {10}^{-4}({T}_{\text{fc}}-298.15)+4.3085\times {10}^{-5}{T}_{\text{fc}}\cdot \left[\text{ln}({P}_{{H}_{2}})+\text{ln}\left(\sqrt{{P}_{{O}_{2}}}\right)\right]\end{array}$$
(6)

where \({T}_{\text{fc}}\) is the cell’s absolute operating temperature in Kelvin, while \({P}_{{H}_{2}}\) and \({P}_{{O}_{2}}\) denote the partial pressures of hydrogen and oxygen in the fuel cell stack’s input channels (atm). When hydrogen and air serve as the inputs, the partial oxygen pressure, \({P}_{{O}_{2}}\), is determined as follows82,83:

$$\begin{array}{c}{P}_{{O}_{2}}={P}_{\text{c}}-R{H}_{\text{c}}{P}_{{H}_{2}O}^{\text{sat}}-\frac{0.79}{0.21}{P}_{{O}_{2}}\cdot \exp\left(0.291\frac{{I}_{\text{fc}}}{A}/{T}_{\text{fc}}^{0.832}\right)\end{array}$$
(7)

where \({P}_{\text{c}}\) represents the inlet channel pressure at the cathode (atm), \(R{H}_{\text{c}}\) is the cathode electrode’s relative humidity, \({I}_{\text{fc}}\) is the operating current (A), \(A\) is the membrane surface area (cm2), and \({P}_{{H}_{2}O}^{\text{sat}}\) is the water vapor pressure at saturation, defined by84:

$$\begin{array}{c}{\text{log}}_{10}({P}_{{H}_{2}O}^{\text{sat}})=2.95\times {10}^{-2}({T}_{\text{fc}}-273.15)-9.18\times {10}^{-5}({T}_{\text{fc}}-273.15{)}^{2}\\ +1.44\times {10}^{-7}({T}_{\text{fc}}-273.15{)}^{3}-2.18\end{array}$$
(8)

In cases where hydrogen and pure oxygen are used, the partial oxygen pressure \({P}_{{O}_{2}}\) is calculated as follows84:

$$\begin{array}{c}{P}_{{O}_{2}}=R{H}_{\text{c}}{P}_{{H}_{2}O}^{\text{sat}}\left[{\left(\text{exp}\left(4.192\frac{1}{{I}_{\text{fc}}}/{T}_{\text{fc}}^{1.334}\right)\cdot \frac{R{H}_{\text{c}}{P}_{{H}_{2}O}^{\text{sat}}}{{P}_{\text{a}}}\right)}^{-1}-1\right]\end{array}$$
(9)

Equation (7) describes the reaction process at the cathode when air supply is used because it includes nitrogen which makes up most of air composition. The operating conditions of PEMFC systems that use air as their oxidant find accurate representation through Eq. (7). Equation (9) becomes applicable for PEMFC operations when pure oxygen is fed to the cathode. Specialized applications require pure oxygen as an oxidant because they need either enhanced performance or unique experimental settings. PEMFC applications require a specific equation based on the choice of oxidant between air or pure oxygen. The use of air as an oxidant requires the implementation of Eq. (7) because nitrogen affects the partial oxygen pressure significantly. The use of pure oxygen requires Eq. (9) as the preferred calculation method because nitrogen is absent from pure oxygen environments. The PEMFC models studied in this work mainly use Eq. (7) because they operate with air as their oxidant. The equation successfully represents nitrogen effects to model partial oxygen pressure accurately for standard PEMFC operational simulations. The application of Eq. (9) requires pure oxygen systems but the present research models do not use pure oxygen.

In both cases, the partial hydrogen pressure \({P}_{{H}_{2}}\) is given by:

$$\begin{array}{c}{P}_{{H}_{2}}=0.5R{H}_{\text{a}}{P}_{{H}_{2}O}^{\text{sat}}\left[{\left(\text{exp}\left(1.635\frac{1}{{I}_{\text{fc}}}/{T}_{\text{fc}}^{1.334}\right)\cdot \frac{R{H}_{\text{a}}{P}_{{H}_{2}O}^{\text{sat}}}{{P}_{\text{a}}}\right)}^{-1}-1\right]\end{array}$$
(10)

where \({P}_{\text{a}}\) is the anode electrode’s inlet channel pressure (atm), and \(R{H}_{\text{a}}\) indicates the relative humidity on the anode side.

The activation voltage drop \(\Delta {V}_{\text{act}}\) for the electrodes is calculated by:

$$\begin{array}{c}\Delta {V}_{\text{act}}=-\left[{\xi }_{1}+{\xi }_{2}{T}_{\text{fc}}+{\xi }_{3}{T}_{\text{fc}}\text{ln}({C}_{{O}_{2}})+{\xi }_{4}{T}_{\text{fc}}\text{ln}({I}_{\text{fc}})\right]\end{array}$$
(11)

where \({\xi }_{1},{\xi }_{2},{\xi }_{3},\) and \({\xi }_{4}\) are empirical coefficients, and \({C}_{{O}_{2}}\) denotes the oxygen concentration at the cathode (mol/cm3) as follows:

$$\begin{array}{c}{C}_{{O}_{2}}=\frac{{P}_{{O}_{2}}}{5.08\times {10}^{6}\cdot \text{exp}(-498/{f}_{\text{fc}})}\end{array}$$
(12)

The ohmic resistive voltage drop \(\Delta {V}_{\text{ohm}}\) is determined by:

$$\begin{array}{c}\Delta {V}_{\text{ohm}}={I}_{\text{fc}}({R}_{M}+{R}_{C})\end{array}$$
(13)

where \({R}_{M}\) is the membrane resistance (Ω) and \({R}_{C}\) is the resistance due to proton movement through the membrane. Membrane resistance is calculated as:

$$\begin{array}{c}{R}_{M}=\frac{{\rho }_{M}\cdot l}{A}\end{array}$$
(14)

with \({\rho }_{M}\) being specific membrane resistance (Ω·cm), \(l\) representing membrane thickness (cm), and the empirical formula for \({\rho }_{M}\) given as:

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

where \(\lambda\) is an adjustable parameter connected to membrane preparation.

The concentration voltage drop, \(\Delta {V}_{\text{con}}\), is determined by:

$$\begin{array}{c}\Delta {V}_{\text{con}}=-bln\left(1-\frac{J}{{J}_{\text{max}}}\right)\end{array}$$
(16)

where \(b\) is a parametric coefficient (V); \(J\) and \({J}_{\text{max}}\) are the current density and maximum current density (A/cm2), respectively.

To ensure accurate modeling under simulation and control conditions, precise estimation of these parameters is essential. Seven unknown parameters (\({\xi }_{1},{\xi }_{2},{\xi }_{3},{\xi }_{4},\lambda ,{R}_{C}\), and \(b\)) are optimized using the proposed optimization technique.

Objective function

To closely align the model output with experimental PEMFC data, the optimization problem is solved by employing the proposed technique, minimizing the sum of squared errors (SSE) between experimentally measured and calculated stack voltages85,86:

$$\begin{array}{c}{\text{O}}{\text{F}}=\min{\text{S}}{\text{S}}{\text{E}}(x)=\min\sum_{i=1}^{N} [{v}_{\text{meas}}(i)-{v}_{\text{cal}}(i){]}^{2}\end{array}$$
(17)

where \(x\) represents the unknown parameter vector, \(N\) is the number of data points, \(i\) is the iteration index, \({v}_{\text{meas}}\) is the measured PEMFC voltage, and \({v}_{\text{cal}}\) is the estimated voltage. \(x\) is the vector of parameters to be optimized, and the constraints ensure the parameters remain within feasible lower and upper bound ranges \({\xi }_{1}[-1.1997,-0.8532]\), \({\xi }_{2}[1.0\times {10}^{-3},5.0\times {10}^{-3}]\), \({\xi }_{3}[3.6\times {10}^{-5},9.8\times {10}^{-5}]\), \({\xi }_{4}[-2.600\times {10}^{-4},-0.954\times {10}^{-4}]\), \(\lambda [\text{14,23}]\), \(Rc(\Omega )[1.0\times {10}^{-4},8.0\times {10}^{-4}]\), and \(\beta [1.36\times {10}^{-2},50.00\times {10}^{-2}]\).

The optimization is subject to the following constraints:

$$\genfrac{}{}{0pt}{}{{\xi }_{i,\text{min}}\le {\xi }_{i}\le {\xi }_{i,\text{max}},i=1:4}{\begin{array}{c} {R}_{C\text{min}}\le {R}_{C}\le {R}_{C\text{max}}\\ {\lambda }_{\text{min}} \le \lambda \le {\lambda }_{\text{max}}\\ {b}_{\text{min}} \le b\le {b}_{\text{max}}\end{array}}$$
(18)

where \({\xi }_{i,\text{min}}\) and \({\xi }_{i,\text{max}}\) are the limits for empirical coefficients, \({R}_{C,\text{min}}\) and \({R}_{C,\text{max}}\) are resistance bounds, and \({\lambda }_{\text{min}}\), \({\lambda }_{\text{max}}\), \({b}_{\text{min}}\), and \({b}_{\text{max}}\) define the limits for water content and parametric coefficients. The mean bias error for voltage is calculated as per below equation:

$$MBE=\frac{{\sum }_{i=1}^{N}|{V}_{meas}(i)-{V}_{calc}(i)|}{N}$$
(19)

Particle swarm optimization algorithm for hybrid mutant slime mold

Basic particle swarm optimization

Particle Swarm Optimization (PSO) simulates the cooperative foraging behavior observed in bird flocks, wherein information is shared among members to collectively identify food sources via optimal routes87. A particle’s current position \({X}_{i}\), flight velocity \({V}_{i}\), and personal best position \({P}_{i}\) are expressed mathematically in Eq. (20):

$$\begin{array}{c}\left\{\begin{array}{l}{X}_{i}=({x}_{i1},{x}_{i2},\dots ,{x}_{in})\\ {V}_{i}=({v}_{i1},{v}_{i2},\dots ,{v}_{in})\\ {P}_{i}=({p}_{i1},{p}_{i2},\dots ,{p}_{in})\end{array}\right.\end{array}$$
(20)

The velocity and position of each particle are updated using Eqs. (21) and (22):

$$\begin{array}{c}{V}_{i}(t+1)={V}_{i}(t)\cdot w+{C}_{1}{r}_{1}({P}_{i}(t)-{X}_{i}(t))+{C}_{2}{r}_{2}({P}_{g}(t)-{X}_{i}(t))\end{array}$$
(21)
$$\begin{array}{c}{X}_{i}(t+1)={X}_{i}(t)+{V}_{i}(t+1)\end{array}$$
(22)

where \(t\) represents the current iteration number, \(w\) is the inertia coefficient, \({C}_{1}\) and \({C}_{2}\) are the self-perception and social learning coefficients, respectively, and \({r}_{1},{r}_{2}\) are random values88,89.

Proposed particle swarm optimization algorithm for hybrid mutant slime mold

Despite PSO’s widespread application and its established effectiveness, it often struggles with exploration in complex scenarios, leading to premature convergence at local optima. To address these shortcomings, a novel PSO variant, named SCPSO, was developed with the following enhancements:

  1. 1.

    Improved Good Point Set Strategy: This ensures a more evenly distributed initial population, enhancing diversity.

  2. 2.

    Identification Attack Strategy: Incorporates dynamic inertia weight and the recognition attack mechanism from the Coati Optimization Algorithm (COA) to swiftly identify optimal prey locations and improve velocity updates.

  3. 3.

    Fusion of Mutated SMA: Combines PSO with a mutated Slime Mold Algorithm (SMA) to expand the search space and avoid local optima.

  4. 4.

    Sigmoid Function: A nonlinear function is integrated to broaden the exploration range.

Good point set

Improving the initialization diversity significantly enhances the algorithm’s capability to identify global optima. Traditional PSO generates populations randomly, often resulting in uneven distribution. To address this, the good point set method is utilized for creating a more uniform population, as described in Eqs. (23) and (24):

$$\begin{array}{c}r=({r}_{1},{r}_{2},\dots ,{r}_{n})\end{array}$$
(23)
$$\begin{array}{c}{r}_{i}=\hbox{mod}(2\cos(2\pi j/7),1), (1\le i\le N, 1\le j\le M)\end{array}$$
(24)

where \(N\) represents the number of individuals and \(M\) the number of variables.

An enhanced version of \({r}_{i}\), providing a more uniformly distributed population, is represented in Eq. (25):

$$\begin{array}{c}{r}_{i}=\hbox{mod}(1.8\cos(2\pi j/7),1)\end{array}$$
(25)

A set of \(m\) good points is constructed as shown in Eq. (26):

$$\begin{array}{c}{P}_{n}(i)=\{({r}_{1},{r}_{2},\dots ,{r}_{n})\}, 1\le i\le N\end{array}$$
(26)

Mapping \({P}_{n}\) onto the feasible ___domain generates the initial population as detailed in Eq. (27):

$$\begin{array}{c}{x}_{(i,j)}=L{b}_{j}+{P}_{n}(i)(U{b}_{j}-L{b}_{j})\end{array}$$
(27)

where \(Ub\) and \(Lb\) are the upper and lower bounds, and \({x}_{(i,j)}\) represents the initialized individual.

Identification attack strategy

The identification attack strategy employs a dynamic inertia weight and the recognition mechanism from the Coati Optimization Algorithm (COA) to enhance the particle’s ability to identify prey quickly. This strategy uses the first phase of COA, where particles update their velocity and position based on prey recognition, as represented in Eq. (28):

$$\begin{array}{c}{x}_{(i,j)}^{\text{new,P1}}=\left\{\begin{array}{ll}{x}_{(i,j)}+r\cdot (p-I\cdot {x}_{(i,j)}),& \text{if }{F}_{pi}<{F}_{i}\\ {x}_{(i,j)}+r\cdot (I\cdot {x}_{(i,j)}-p),& {\text{else}}\end{array}\right.\end{array}$$
(28)

Subsequent updates are performed as shown in Eq. (29):

$$\begin{array}{c}{x}_{(i,j+1)}=\left\{\begin{array}{ll}{x}_{(i,j)}+\text{rand}(1,{\text{Dim}})\cdot (p-{x}_{(i,j)}),& \text{if }{F}_{pi}<{F}_{i}\\ {x}_{(i,j)}+\text{rand}(1,{\text{Dim}})\cdot ({x}_{(i,j)}-p),& {\text{else}}\end{array}\right.\end{array}$$
(29)

Velocity updates, incorporating position adjustments, are detailed in Eq. (30):

$$\begin{array}{c}{V}_{i}(t+1)={V}_{i}(t)\cdot {W}_{t}+{C}_{1}\cdot {r}_{1}({P}_{i}(t)-{X}_{i}(t))+{C}_{2}\cdot {L}_{F}\cdot {r}_{2}({P}_{g}(t)-{X}_{i}(t))\end{array}$$
(30)

where \({W}_{t}\) and \({L}_{F}\) are defined in Eqs. (31) and (32):

$$\begin{array}{c}{W}_{t}={W}_{\text{max}}-t\cdot \frac{{W}_{\text{max}}-{W}_{\text{min}}}{\text{MaxT}}\end{array}$$
(31)
$$\begin{array}{c}{L}_{F}=0.05\times \frac{\theta \times \sigma }{|\rho {|}^{\frac{1}{\beta }}}\end{array}$$
(32)

with \(\sigma\) defined in Eq. (33):

$$\begin{array}{c}\sigma ={\left(\frac{\Gamma (1+\beta )\times \text{sin}(\pi \beta /2)}{\Gamma ((1+\beta )/2)\times \beta \times {2}^{(\beta -1)/2}}\right)}^{1/\beta }\end{array}$$
(33)

In these equations, \(\theta\) and \(\rho\) are normally distributed random numbers.

Mutant slime mold algorithm

The Mutant Slime Mold Algorithm (SMA) simulates the behavior of slime molds during foraging, where decisions to move towards food are influenced by the intensity of the food scent in the surrounding environment90,91. The position update rule is formulated as shown in Eq. (34):

$$\begin{array}{c}{S}_{\text{new}}=\left\{\begin{array}{ll}{S}_{b}(t)+vb\cdot (W\cdot {S}_{A}(t)-{S}_{B}(t)),& r<f\\ vc\cdot S(t),& r\ge p\end{array}\right.\end{array}$$
(34)

where \(f=\text{tanh}|D(i)-DF|\), \({v}_{b}={\text{unifrnd}}(-a,a,1,N)\), and \({v}_{c}={\text{unifrnd}}(-b,b,1,N)\). \({S}_{b}\) denotes the ___location with the highest food scent concentration, \({S}_{A}\) and \({S}_{B}\) represent two randomly selected slime mold positions, \(D(i)\) is the fitness value of \(S\), and \(DF\) is the best fitness value. The parameters \(a\) and \(b\) are computed using Eqs. (35) and (36):

$$\begin{array}{c}a=arctanh(-t/{\text{M}}{\text{a}}{\text{x}}{\text{T}}+1)\end{array}$$
(35)
$$\begin{array}{c}b=1-t/{\text{M}}{\text{a}}{\text{x}}{\text{T}}\end{array}$$
(36)

The weighting factor \(W\), which reflects the fitness influence, is calculated using Eq. (37):

$$\begin{array}{c}W(D.{\text{S}}{\text{m}}{\text{e}}{\text{l}}{\text{l}}{\text{I}}{\text{n}}{\text{d}}{\text{e}}{\text{x}}(i))=\left\{\begin{array}{ll}1+r\cdot \text{log}\left(\frac{{b}_{\text{fin}}-D(i)}{{b}_{\text{fin}}-{w}_{\text{fin}}}+1\right),& {\text{condition}}\\ 1-r\cdot \text{log}\left(\frac{{b}_{\text{fin}}-D(i)}{{b}_{\text{fin}}-{w}_{\text{fin}}}+1\right),& {\text{otherwise}}\end{array}\right.\end{array}$$
(37)

where “condition” pertains to the top half of the population before sorting \(D(i)\), \(r\) is a random number in [0,1], \({b}_{\text{fin}}\) and \({w}_{\text{fin}}\) represent the best and worst fitness values, respectively, and \(D.{\text{SmellIndex}}\) denotes the fitness rank, as in Eq. (38):

$$\begin{array}{c}D.{\text{S}}{\text{m}}{\text{e}}{\text{l}}{\text{l}}{\text{I}}{\text{n}}{\text{d}}{\text{e}}{\text{x}}=\hbox{sort}(D)\end{array}$$
(38)

The encircling mechanism utilizes feedback between mucus vein width and food concentration. For \({\text{rand}}<z\), positions are updated as per Eq. (39):

$$\begin{array}{c}{X}_{\text{new}}=rand\cdot (UB-LB)+LB, {\text{i}}{\text{f}} \, rand<z\end{array}$$
(39)

where \(UB\) and \(LB\) are the upper and lower bounds. If \({\text{rand}}\ge z\) and the random value \(r\) of venous contraction is less than \(p\), the update follows Eq. (40):

$$\begin{array}{c}{X}_{\text{new}}=X(t)+vb\cdot (W\cdot {X}_{A}(t)-{X}_{B}(t)), r<p\end{array}$$
(40)

For seamless integration with PSO, the weighting factor \(W\) is eliminated, yielding the updated formula in Eq. (41):

$$\begin{array}{c}{X}_{\text{new}}=X(t)+vb\cdot ({X}_{A}(t)-{X}_{B}(t)), r<p\end{array}$$
(41)

and for \(r\ge p\), the update is given by Eq. (42):

$$\begin{array}{c}{X}_{\text{new}}=vc\cdot X(t), r\ge p\end{array}$$
(42)

Mutation processes refine particle positions systematically. This involves randomly selecting two individuals, scaling their vector difference, and combining them with a target to create a mutant individual \({v}_{(i,l+1)}=\{{v}_{(i,l+1)}^{1},{v}_{(i,l+1)}^{2},\dots ,{v}_{(i,l+1)}^{d}\}\), as shown in Eq. (43):

$$\begin{array}{c}{v}_{(i,l+1)}={x}_{(r1,l)}+{F}_{1}\times ({x}_{(r2,l)}-{x}_{(r3,l)})\end{array}$$
(43)

where \({x}_{(r1,l)},{x}_{(r2,l)},{x}_{(r3,l)}\) are three distinct individuals, and \({F}_{1}\) is the adaptive variance operator defined as \({F}_{1}={F}_{0}\cdot {2}^{\lambda }\), with \(\lambda ={e}^{1-L/(L+1-l)}\). The superior individual is determined using greedy selection, expressed in Eq. (44):

$$\begin{array}{c}{x}_{(i,l+1)}=\left\{\begin{array}{ll}{v}_{(i,l+1)},& \text{if }f({v}_{(i,l+1)})\le f({x}_{(i,l)})\\ {x}_{(i,l)},& {\text{otherwise}}\end{array}\right.\end{array}$$
(44)

The incorporation of differential mutation strategy broadens the search scope dynamically. This hybrid approach effectively combines SMA with PSO, enhancing exploration and exploitation capabilities while reducing the risk of premature convergence.

Sigmoid function

The Sigmoid function, widely used in logistic regression, epidemic modeling, and growth analysis, facilitates nonlinear scaling to expand the algorithm’s search space. Its basic expression is given in Eq. (45):

$$\begin{array}{c}S=\frac{1}{1+{e}^{-t}}\end{array}$$
(45)

where \(e\) is the base of the natural logarithm. Without this function, the particle’s input follows a linear path. To enhance search capabilities, a nonlinear adjustment is introduced in Eq. (46):

$$\begin{array}{c}{X}_{i}(t+1)=S\cdot {X}_{i}(t)+{V}_{i}(t+1)\end{array}$$
(46)

The pseudo-code for SCPSO outlines these enhancements systematically in Algorithm 1.

Algorithm 1
figure a

Proposed SCPSO Algorithm

SCPSO complexity analysis

The time complexity of SCPSO is derived from the three main stages of the algorithm: initialization, updating of speed and position information, and the integration of the mutant slime mold algorithm. The time complexity of SCPSO is computed as follows:

$$\begin{aligned} & O\left( {{\text{SCPSO}}} \right) = O\left( {{\text{initialization}}} \right) + O\left( {{\text{MaxT}} \cdot O\left( {{\text{position~and~velocity~update}}} \right)} \right) \\ & \quad + O\left( {{\text{mutated~SMA}}} \right) = O\left( {NM} \right) + O\left( {{\text{MaxT}} \cdot NM} \right) \\ & \quad + O\left( {{\text{MaxT}} \cdot NM} \right) = O\left( {NM + \left( {{\text{MaxT}} + 1} \right)} \right) \\ \end{aligned}$$
(47)

Result analysis and discussion

A novel hybrid optimization algorithm, SCPSO (a particle swarm optimization for mixed mutant slime mold), was rigorously evaluated and compared with advanced state-of-the-art algorithms for parameter estimation in PEMFC modeling in this study. The competing algorithms were Fick’s Law Algorithm (FLA), Hybrid Firefly and Particle Swarm Optimization (HFPSO), Particle Swarm Optimization with an Enhanced Learning Strategy and Crossover Operator (PSOLC), Equilibrium Slime Mold Algorithm (ESMA), Leader Slime Mold Algorithm (LSMA), Adaptive Hybrid Dandelion Optimizer (DETDO), and Golden Jackal Optimization Applying Cross Evolutionary Strategies (EGJO). Table 1 shows the default parameter setting used in this analysis. These algorithms were applied to six PEMFC models: Table 2 lists the BCS 500 W, SR-12 500 W, STD 250 W, Nedstack PS6 600 W, Horizon H-12, and Ballard Mark V.

Table 1 Standard parameter settings for the algorithms under comparison.
Table 2 Properties of the six PEMFCs used in this research.

Evaluate the performance of the SCPSO algorithm, three key statistical metrics were employed Standard Deviation (STD), Runtime (RT), and Friedman Ranking (FR). The mathematical formulations for these metrics are provided below. The Standard Deviation (STD) measures the dispersion of the Sum of Squared Errors (SSE) across multiple runs of the algorithm. A lower STD indicates higher stability and consistency in the algorithm’s performance. The STD is calculated as: \({\text{STD}}=\sqrt{\frac{1}{N-1}\sum_{i=1}^{N} ({\text{SSE}}_{i}-\overline{\text{SSE}}{)}^{2}}\) . Where \(N\) is the number of runs, \({\text{SSE}}_{i}\) is the Sum of Squared Errors for the \(i\)-th run, and \(\overline{\text{SSE}}\) is the mean SSE across all runs. The Runtime (RT) measures the computational time required by the algorithm to converge to the optimal solution. It is expressed in seconds and is calculated as: \({\text{RT}}={t}_{\text{end}}-{t}_{\text{start}}\). Where \({t}_{\text{start}}\) is the time at which the algorithm begins execution, and \({t}_{\text{end}}\) is the time at which the algorithm completes execution. The Friedman Ranking (FR) is a non-parametric statistical test used to compare the performance of multiple algorithms across different datasets. The FR assigns ranks to each algorithm based on its performance, with the best-performing algorithm receiving the lowest rank. The FR is calculated as for each dataset, rank the algorithms based on their performance (e.g., SSE values), with the best performance receiving rank 1. Compute the average rank for each algorithm across all datasets. The Friedman statistic (\({\chi }_{F}^{2}\)) is calculated as: \({\chi }_{F}^{2}=\frac{12N}{k(k+1)}\left[\sum_{j=1}^{k} {R}_{j}^{2}-\frac{k(k+1{)}^{2}}{4}\right]\) Where \(N\) is the number of datasets, \(k\) is the number of algorithms, and \({R}_{j}\) is the average rank of the \(j\)-th algorithm.The critical value for the Friedman test is determined based on the degrees of freedom (\(k-1\)) and the desired significance level. If the calculated \({\chi }_{F}^{2}\) exceeds the critical value, the null hypothesis (that all algorithms perform equally) is rejected.

The BCS 500 W PEMFC model uses data obtained through experimental research and validated literature datasets which stem from references69,70,75. The references contain essential electrochemical and operational data needed for both modeling and optimization purposes. The Nedstack PS6 600 W PEMFC model operates using experimental data and performance curves obtained from Nedstack Fuel Cell Technology. The dataset contains essential parameters including I-V and P–V characteristics which are cited in71,75. The SR-12 500 W PEMFC model draws its data from experimental studies and validated datasets which are found in references69,70. The references deliver extensive details about electrochemical performance together with operational specifications of SR-12 PEMFC. The Horizon H-12 PEMFC model derives its foundation from experimental data and performance curves which Horizon Fuel Cell Technologies has provided. The dataset contains complete I-V and P–V characteristic information which is documented in reference72. The Ballard Mark V PEMFC model originates from experimental data and performance curves Ballard Power Systems has published. The dataset contains essential parameters of I-V and P–V characteristics which are documented in72,75. The STD 250 W Stack PEMFC model uses experimental data and validated datasets found in references69,70 for its development. The references contain complete operational and electrochemical information needed for optimization and modeling purposes. The data sources guarantee both accuracy and reliability of PEMFC models throughout this study which allows for accurate parameter optimization and validation of the proposed SCPSO algorithm.

The experiments were performed using MATLAB 2021a on a PC with Windows Server 2019 and i7-11700 k CPU @ 3.6 GHz. For each algorithm, we set a maximum of 500 iterations, 30 independent runs, and a population size of 40. The results show that SCPSO consistently outperformed the other algorithms in terms of faster convergence rates and better stability for all PEMFC models. With fewer iterations, it achieved the lowest sum of squared errors (SSE) than its competitors. SCPSO generated current voltage (I/V) and voltage power (V/P) characteristics that were in close alignment with experimental data, indicating its highly accurate and reliable PEMFC parameter modeling. The adaptability of SCPSO suggests its potential for real world optimization of PEMFC systems. Improvements in minimizing SSE across all tested models were statistically significant. SCPSO’s stability was further highlighted by comparative plots with error bars, showing a narrow distribution of SSE values that was consistently better than the variability in other algorithms. The results demonstrate that SCPSO is a powerful and reliable tool for parameter estimation and optimization in PEMFC applications, and outperforms advanced competitors such as LSMA, DETDO, and EGJO.

FC1: BCS 500 W

Table 3 summarizes the results of SSE minimization during parameter optimization for PEMFC1, where SCPSO shows outstanding performance. SCPSO has the lowest Mean SSE (0.02549) and is consistent across its Min. SSE (0.02549) and Max. SSE (0.02549) values are highly precise and stable. SCPSO’s negligible standard deviation (1.05958E-15) supports this performance as this implies that the optimization output is almost uniform across multiple runs. Other algorithms, like HFPSO (Std. = 0.001998568) and LSMA (Std. = 0.005520218), are much more variable, and hence less reliable. Moreover, SCPSO has the best Friedman Rank (FR = 1) confirming that it is the best overall performer among all the algorithms and is better than DETDO (FR = 4) and HFPSO (FR = 4.8). Moreover, SCPSO has computational efficiency, which results in the shortest runtime (RT = 3.02859) among all algorithms, which is essential for practical applications. Although DETDO (RT = 3.43297) and LSMA (RT = 3.61579) are close in runtime, SCPSO is the best choice for parameter tuning in PEMFC applications due to its simultaneous optimization accuracy and efficiency.

Table 3 The optimized parameters and the optimal function value for FC1.

The results in Case 1 show that the minimum value of 0.02549 was achieved by SCPSO, which was slightly better than other algorithms and comparable to ESMA. FLA, HFPSO, PSOLC, LSMA, DETDO and EGJO were outperformed by SCPSO by 56.27%, 0.78%, 2.93%, 13.99%, 0.55% and 0.08%, respectively. The maximum value of 0.02549 was obtained by SCPSO, which outperformed all other algorithms. SCPSO outperformed FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO by 86.22%, 17.12%, 27.01%, 2.45%, 40.46%, 3.44%, and 0.43%, respectively. The overall best performance was achieved by SCPSO with the lowest mean value of 0.02549. Compared to the mean values of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO and EGJO, SCPSO was 75.50%, 7.34%, 11.61%, 0.81%, 22.99%, 2.42% and 0.20% lower. Moreover, SCPSO had the highest stability with standard deviation of 1.05958E-15, which was the lowest across all algorithms. Standard deviation of SCPSO was 99.99%, 99.95%, 99.98%, 99.97%, 99.99%, 99.99%, and 99.99% lower than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The most efficient algorithm was SCPSO with the fastest runtime of 3.02859. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were 23.82%, 36.05%, 52.64%, 52.64%, 16.23%, 11.74%, and 25.06% slower than SCPSO. Finally, the Friedman rank of 1.0 was obtained by SCPSO, which outperformed all other algorithms significantly. SCPSO’s Friedman rank was 87.50%, 79.17%, 83.33%, 66.67%, 85.42%, 75.00%, and 58.33% better than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. Across all metrics, SCPSO was the most robust and efficient algorithm in this case.

In Fig. 3a, SCPSO is in excellent agreement with experimental data, outperforming algorithms such as HFPSO and PSOLC, which deviate significantly at higher current densities. As shown in Fig. 3b, SCPSO converges to the minimum SSE faster than ESMA and HFPSO in fewer iterations. Finally, the box plot in Fig. 3c shows that SCPSO is the best in minimizing SSE, with the narrowest spread among all algorithms. On the contrary, the variance in the output of optimization using FLA and HFPSO is high, and there is high variability and, therefore, uncertainty.

Fig. 3
figure 3

FC1: (a) V–I, P–V, and error curve; (b) convergence curve; (c) box plot.

Finally, SCPSO is proved to be the best algorithm for PEMFC1 optimization in terms of minimizing SSE, computational efficiency and experiment alignment. With its best Friedman Rank (FR = 1), its low runtime and small variability, it outperforms all other tested algorithms. Although the alternatives DETDO and LSMA provide competitive performance, SCPSO is the most reliable, precise and stable PEMFC parameter optimization method.

FC2: NetStack PS6

Table 4 shows that SCPSO performs very well in parameter optimization with the objective of minimizing SSE for PEMFC2 (NetStack PS6). SCPSO is the algorithm with the lowest Mean SSE (0.27521) which is also consistent with its Min. SSE (0.27521) and Max. Values of SSE (0.27521) show that the model is more stable and precise across all iterations. The reliability of this consistency is enhanced by its very small standard deviation (6.75322E-16). On the other hand, FLA (Std. = 0.31795) and HFPSO (Std. = 0.01012) are less consistent, as seen by their greater variability. In addition, SCPSO also obtains the best Friedman Rank (FR = 1) which further confirms its overall better performance than DETDO (FR = 3.4) and HFPSO (FR = 6.4).

Table 4 The optimized parameters and the optimal function value for FC2.

In terms of computational efficiency, SCPSO outperforms all tested algorithms in the shortest runtime (RT = 4.16770). Although algorithms such as DETDO (RT = 5.08664) and LSMA (RT = 5.22783) are competitive, SCPSO offers the best combination of minimal runtime and superior SSE optimization for real time parameter tuning in PEMFC applications.

The results of Case 12 from the given table show that the minimum value of 0.27521 was achieved by SCPSO, which is better than all other algorithms. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were outperformed by SCPSO by 17.55%, 2.12%, 0.08%, 0.38%, 0.22%, 0.09%, and 0.16%, respectively. In addition, SCPSO achieved the lowest maximum value of 0.27521, which was much lower than other algorithms. The results show that, compared to FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, SCPSO outperformed them by 77.43%, 10.51%, 10.94%, 5.71%, 8.00%, 0.53%, and 4.37%, respectively. The best result was achieved by SCPSO with the lowest mean value of 0.27521. The mean value of this was 62.16%, 7.56%, 2.68%, 2.87%, 3.52%, 0.35%, and 1.61% lower than the mean values of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The standard deviation of SCPSO was the highest, which was 6.75322E-16, the least among all of the algorithms. The standard deviation of SCPSO was 99.99%, 99.99%, 99.99%, 99.99%, 99.99%, 99.85%, and 99.99% lower than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The most efficient algorithm was SCPSO with a runtime of 4.16770. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were 18.39%, 6.54%, 50.46%, 56.63%, 20.23%, 18.08%, and 22.91% slower than SCPSO, respectively. Finally, SCPSO had the best Friedman rank of 1.0, which is significantly better than all other algorithms. SCPSO’s Friedman rank was 87.50%, 84.38%, 73.68%, 78.26%, 80.00%, 70.59%, and 73.68% better than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. Across all metrics, SCPSO showed better performance and is the most robust and efficient algorithm in this analysis.

As shown in Fig. 4a, SCPSO tracks experimental data well over the entire range of current densities and outperforms algorithms such as HFPSO and PSOLC, which deviate markedly from experiment, especially at higher densities. As shown in Fig. 4b, the convergence curve of SCPSO is a rapid reduction of SSE, and it needs fewer iterations to reach the optimal solutions than other algorithms. In Fig. 4c, the box plot clearly shows the variability of SSE and SCPSO has the narrowest distribution, which means that it is stable and consistent. On the other hand, the SSE distributions of FLA and HFPSO are broader, indicating greater uncertainty in their results. Finally, SCPSO is the most suitable algorithm for PEMFC2 optimization, because it offers the best compromise between low SSE, high stability and computational efficiency. It is dominant in the Friedman Rank (FR = 1) and is in exact agreement with experimental results. Although DETDO and LSMA are competitive algorithms, SCPSO is a consistent and fast algorithm with robust performance that makes it the best algorithm for PEMFC parameter optimization.

Fig. 4
figure 4

FC2: (a) V–I, P–V, and error curve; (b) convergence curve; (c) box plot.

FC3:SR-12

As shown in Table A1 (Supplementary Data), the SCPSO algorithm performs very well in minimizing SSE and accurate parameter optimization for PEMFC3. SCPSO has the lowest Mean SSE (0.24228) which is consistent with its Min. SSE (0.24228) and Max. SSE (0.24228) values. The negligible standard deviation (5.84682E-16) of this consistency is further validated by the uniform optimization outcomes across multiple iterations. On the other hand, FLA (Std. = 0.16092) and HFPSO (Std. = 0.000757482) are more variable, and hence less reliable. The Friedman Rank (FR = 1) for SCPSO is the first, outperforming DETDO (FR = 3.4) and EGJO (FR = 2.8) in all metrics.

The computational efficiency of SCPSO is illustrated by its runtime (RT = 3.10589), which is among the lowest of all algorithms. For example, PSOLC has a shorter runtime (RT = 2.70507), but its performance is marred by higher SSE values (Mean SSE = 0.24323) and higher variability (Std. = 0.000708732). The combination of precise optimization and competitive runtime of SCPSO makes it an ideal candidate for real world PEMFC applications.

The results in Case 3, as shown in the table, indicate that SCPSO had the lowest minimum value of 0.24228, which was superior to all other algorithms. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO and EGJO were outperformed by SCPSO by 20.74%, 0.01%, 0.08%, 0.03%, 0.70%, 0.01% and 0.00%, respectively. The lowest maximum value of 0.24228 was obtained by SCPSO, which was better than all other algorithms. SCPSO outperformed FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO by 65.39%, 0.74%, 0.73%, 0.25%, 1.37%, 0.21%, and 0.10%, respectively. The best algorithm overall was SCPSO with the lowest mean value of 0.24228. The mean value was 49.05%, 0.20%, 0.39%, 0.08%, 1.11%, 0.07%, and 0.03% lower than the mean values of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The lowest standard deviation of 5.84682E-16 was observed in SCPSO, which is the highest stable algorithm. SCPSO’s standard deviation was 99.99%, 99.92%, 99.92%, 99.74%, 99.90%, 99.70%, and 99.42% less than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. Among the fastest, SCPSO had an efficient runtime of 3.10589. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were 15.53%, 48.20%, 14.79%, 45.82%, 2.17%, 0.14%, and 23.77% slower than SCPSO. Finally, SCPSO obtained the best Friedman rank of 1.0, which was significantly better than all other algorithms. SCPSO’s Friedman rank was 87.50%, 77.27%, 81.48%, 75.00%, 85.71%, 70.59%, and 64.29% better than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. In all metrics, SCPSO achieved the best performance and was the most robust and efficient algorithm in this case.

Additional clarity is provided by insights from the associated figures. In Fig. 5a, SCPSO closely follows experimental data at different current densities. Unlike algorithms such as FLA and LSMA, which show deviations, especially at low voltages, SCPSO has consistent accuracy. Figure 5b shows the convergence curve of SCPSO, which shows that SCPSO reduces SSE quickly and reaches the optimal solution in fewer iterations than ESMA and HFPSO algorithms. Finally, the box plot in Fig. 5c confirms SCPSO’s stability with the narrowest spread in SSE values among all algorithms. The robustness and precision for parameters optimization of SCPSO are shown by this visual distinction.

Fig. 5
figure 5

FC3: (a) V–I, P–V, and error curve; (b) convergence curve; (c) box plot.

FC4:Horizon H-12 PEMFC

As presented in Table A2 (Supplementary Data), SCPSO performs very well for parameter optimization of PEMFC4, in terms of minimizing SSE. The algorithm has the lowest Mean SSE (0.10291) and is consistent across its Min. SSE (0.10291) and Max. SSE (0.10291) values are exceptionally stable and precise. SCPSO results are reliable and consistent across all iterations, as the standard deviation (9.66476E-17) is negligible. In contrast, LSMA (Std. = 0.000515681) and PSOLC (Std. = 0.000225514) are more variable, and therefore less reliable. The best Friedman Rank (FR = 1) is also obtained by SCPSO, thus confirming its superior optimization performance with respect to algorithms such as DETDO (FR = 3.6) and HFPSO (FR = 4.2). In addition to the computational efficiency, SCPSO also has the shortest runtime (RT = 2.84414) among all algorithms and outperforms alternatives such as DETDO (RT = 3.17436) and FLA (RT = 3.41105). Although HFPSO produces a similar runtime (RT = 2.89399), its increased SSE variability and lower precision make SCPSO more suitable for real world applications where stability and accuracy are required.

The results from the given table in Case 4 indicate that SCPSO gave the minimum value of 0.10291, which was similar to that of FLA, HFPSO, and ESMA, and better than that of PSOLC, LSMA, DETDO, and EGJO by 0.13%, 0.20%, 0.01%, and 0.01%, respectively. In addition, SCPSO had the lowest maximum value of 0.10291, which showed that it performed better than all other algorithms. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were outperformed by SCPSO by 3.10%, 0.23%, 0.67%, 0.48%, 1.47%, 0.01%, and 0.01%, respectively. The best overall performance was achieved by SCPSO with the lowest mean value of 0.10291. The mean value of this was 0.78%, 0.07%, 0.39%, 0.12%, 0.65%, 0.01%, and 0.01% lower than the mean values of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The highest stability was also demonstrated by SCPSO, with a standard deviation of 9.66476E-17, which is the lowest among all algorithms. The standard deviation of SCPSO was 99.99%, 99.91%, 99.95%, 99.95%, 99.98%, 99.93%, and 99.95% lower than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The most efficient algorithm was SCPSO with the fastest runtime of 2.84414. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO and EGJO were 16.62%, 1.73%, 52.07%, 51.18%, 10.18%, 10.40%, and 19.21% slower than SCPSO. Finally, SCPSO had the best Friedman rank of 1.0, and significantly outperformed all other algorithms. SCPSO outperformed FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO in terms of Friedman rank, with 77.27%, 76.19%, 85.71%, 77.27%, 85.71%, 72.22%, and 77.27% better, respectively. Across all metrics, SCPSO performed better, and was the most robust and efficient algorithm in this case.

The associated figures provide further insights. Figure 6a shows that SCPSO closely follows experimental data and outperforms alternatives, such as PSOLC and LSMA, which deviate at different current densities. Figure 6b shows the convergence curve of SCPSO which converges faster than ESMA and HFPSO in terms of reducing the SSE, and reaches optimal solutions with fewer iterations. Finally, the narrowest SSE distribution among all tested algorithms is visually confirmed by the box plot shown in Fig. 6c, which proves SCPSO’s stability. However, SCPSO stands out as the most reliable choice for minimizing SSE compared to broader spreads observed for algorithms such as LSMA and PSOLC.

Fig. 6
figure 6

FC4: (a) V–I, P–V, and error curve; (b) convergence curve; (c) box plot.

FC5: Ballard Mark V PEMFC

Parameter optimization in PEMFC5 (Ballard Mark V PEMFC), SCPSO is evaluated, and the results are reported in Table A3 (Supplementary Data). The lowest Mean SSE (0.14863) is achieved by SCPSO, which also perfectly matches its Min. SSE (0.14863) and Max. The SSE (0.14863) values are unparalleled in stability and precision. Having a practically zero standard deviation (6.07143E–16) means that the performance is consistent among iterations. In contrast to FLA (Std. = 0.02034) and HFPSO (Std. = 0.002603561) which are more variable. The Friedman Rank (FR = 1) also shows, that SCPSO performs better compared to algorithms even as EGJO (FR = 2) and DETDO (FR = 3.6).

The computational efficiency of SCPSO is analyzed for this PEMFC and it shows competitive runtime (RT = 2.77338). HFPSO has slightly faster runtime (RT = 2.87990) but higher SSE variability and lower precision, thus SCPSO is preferred. While both PSOLC and ESMA have competitive precision (RT = 7.13371 and RT = 5.38939, respectively), they are significantly slower than SCPSO.

The results in Case 5 from the table provided indicate that SCPSO has the lowest minimum value of 0.14863, which is the same as EGJO and better than FLA, HFPSO, PSOLC, ESMA, LSMA and DETDO by 0.81%, 0.48%, 0.21%, 0.01%, 0.34% and 0.05%, respectively. SCPSO also attained the lowest maximum value of 0.14863, which is much better than all other algorithms. SCPSO achieved better performance than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO by 25.98%, 4.64%, 1.33%, 0.47%, 2.24%, 0.19%, and 0.03%, respectively. The results show that the mean value of SCPSO was the lowest (0.14863), which proves its better performance. The mean value of this was 10.58%, 2.57%, 0.49%, 0.15%, 1.10%, 0.10%, and 0.01% lower than the mean values of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. Among all algorithms, SCPSO also showed the highest stability with a standard deviation of 6.07143E-16. The standard deviation of SCPSO was 99.99%, 99.98%, 99.92%, 99.78%, 99.95%, 99.33%, and 99.64% lower than those of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The most efficient algorithm was SCPSO with the fastest runtime of 2.77338. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were 23.06%, 3.70%, 61.12%, 48.52%, 4.69%, 7.99%, and 24.34% slower than SCPSO, respectively. Finally, SCPSO had the best Friedman rank of 1.0, and it significantly outperformed all other algorithms. The Friedman rank of SCPSO was 87.18%, 84.85%, 81.48%, 72.22%, 83.33%, 72.22%, and 50.00% better than those of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. In this case, SCPSO showed excellent performance on all metrics, and was the most robust and efficient algorithm.

The figures in this case show SCPSO’s ability to align with experimental data. As shown in Fig. 7a, SCPSO is in excellent agreement with experimental data at all current densities and outperforms algorithms such as PSOLC and LSMA, which deviate from experiment at higher currents. The convergence curve in Fig. 7b shows that SCPSO can reduce SSE rapidly and requires less iteration to reach the optimal solution than competitors such as DETDO and ESMA. Finally, the box plot in Fig. 7c indicates that SCPSO is stable with the narrowest spread of SSE values compared to other algorithms such as FLA and HFPSO. The stability of SCPSO also further confirms the reliability of SCPSO in parameter optimization for PEMFC5.

Fig. 7
figure 7

FC5: (a) V–I, P–V, and error curve; (b) convergence curve; (c) box plot.

FC6: STD 250 W Stack

Table A4 (Supplementary Data) shows that SCPSO performs very well in parameter optimization to minimize SSE for PEMFC6 (STD 250 W Stack). The lowest Mean SSE (0.28377) is achieved by SCPSO, and it is also the Min. SSE (0.28377) and Max. SSE (0.28377) values are without a doubt the most consistent across all iterations. The standard deviation of the algorithm (1.46869E16) is effectively zero, indicating its stability and reliability. In contrast, algorithms like FLA (Std. = 0.044418229) and LSMA (Std. = 0.021099587) show much higher variability. The superiority of SCPSO over alternatives such as PSOLC (FR = 5.2) and HFPSO (FR = 3.8) is further confirmed by its top ranking Friedman Rank (FR = 1).

In this case, SCPSO also shows its computational efficiency with low runtime (RT = 3.05012). However, SCPSO has a slightly slower runtime (RT = 3.25967) but a lower SSE variability and higher precision. Although FLA and ESMA are competitive in terms of precision, they are much slower (RT = 10.6803 and RT = 6.48715, respectively), which makes SCPSO’s performance in terms of computational time even more evident.

The results from the table provided in Case 6 show that SCPSO had the lowest minimum value of 0.28377, which is equal to that of HFPSO and ESMA and better than FLA, PSOLC, LSMA, DETDO and EGJO by 9.14%, 0.02%, 1.21%, 0.01%, 0.00% respectively. The lowest maximum value of 0.28377 was also achieved by SCPSO, which proved its better performance. SCPSO achieved better results compared to FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO and EGJO and outperformed them by 32.77%, 10.70%, 14.41%, 0.13%, 15.27%, 0.21%, and 0.02%, respectively. The performance of SCPSO over all metrics was confirmed by achieving the lowest mean value of 0.28377. The mean value of FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were 20.43%, 2.34%, 3.94%, 0.05%, 8.93%, 0.09%, and 0.01% less than the mean value of this proposed method. The lowest standard deviation of 1.46869E-16 was also shown by SCPSO, which was the most stable algorithm among all. Standard deviation of SCPSO was 99.99%, 99.99%, 99.99%, 99.99%, 99.99%, 99.99%, and 98.94% lower than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The most efficient algorithm was SCPSO, with a runtime of 3.05012. FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO were 71.44%, 41.49%, 6.43%, 52.98%, 50.98%, 17.20%, and 58.69% slower than SCPSO, respectively. Finally, SCPSO obtained the best Friedman rank of 1.0, which was significantly better than all other algorithms. SCPSO’s Friedman rank was 86.49%, 73.68%, 80.77%, 73.68%, 85.71%, 79.17%, and 66.67% better than FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO, respectively. The results show that SCPSO performed best on all metrics, making it the most robust and efficient algorithm in this analysis.

In this case, we focus on the alignment of SCPSO predictions with experimental results as shown in the figures. Figure 8a shows that SCPSO agrees well with experimental data and performs better than DETDO and LSMA, which have larger deviations at different current densities. As shown in Fig. 8b, SCPSO’s rapid decline in SSE leads to optimal solutions more quickly than its competitors, HFPSO and ESMA. Finally, the narrowest distribution of SSE in the box plot in Fig. 8c visually confirms the stability of SCPSO among all tested algorithms. SCPSO’s effectiveness in parameter optimization for PEMFC6 is reinforced by this stability and precision.

Fig. 8
figure 8

FC6: (a) V–I, P–V, and error curve; (b) convergence curve; (c) box plot.

The stability and accuracy evaluation of the proposed SCPSO algorithm occurred when analyzing PEMFC stack (BCS 500 W, NedStack PS6 600 W, SR-12 W, Horizon H-12, Ballard Mark V, and STD 250 W Stack) dynamic operating conditions that involved cell temperature and pressure fluctuations. The PEMFC stack dynamic voltage and power responses under different operating conditions are shown in Figs. 3a, 4a, 5a, 6a, 7a, 8a. The PEMFC stack operating temperature received variations between ± 10% of its nominal temperature point for each stack. The experimental data was compared against the recorded dynamic voltage and power responses. Analysis results show that SCPSO algorithm successfully forecasts PEMFC stack dynamics precisely when compared to experimental measurements. The BCS 500 W stack showed a relative error between predicted and experimental voltage outputs which stayed under 0.06% throughout the entire temperature range. Based on experimental data the SCPSO algorithm showed identical accuracy levels across all PEMFC stacks when subjected to temperature modifications.

The simulation evaluated hydrogen and oxygen inlet pressure variations between ± 15% of their nominal values which represents typical operating environments. Under dynamic pressure conditions the SCPSO algorithm demonstrates both high accuracy and stability in its voltage and power responses. The NedStack PS6 600 W stack demonstrated experimental power output predictions with relative errors (RE) under 0.05% throughout the entire pressure range. The algorithm demonstrates effective performance in varying operating conditions because it delivers consistent accuracy results. The dynamic operation analysis demonstrates that SCPSO algorithm operates accurately and robustly when cell temperatures and pressures change. The algorithm demonstrates excellent suitability for real-world PEMFC stack applications because it keeps experimental data deviations minimal during dynamic operating conditions. The algorithm demonstrates capabilities that make it suitable for real-time control systems of PEMFCs because it delivers precise parameter estimation and dynamic response prediction needed for optimal performance.

further validate the performance of the Slime Mold-Enhanced Convergent Particle Swarm Optimizer (SCPSO) algorithm, a comprehensive statistical analysis was conducted. The analysis included the calculation of Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Correlation Coefficient (R), and Efficiency for SCPSO and the comparative algorithms (FLA, HFPSO, PSOLC, ESMA, LSMA, DETDO, and EGJO). These metrics provide a deeper understanding of the algorithm’s accuracy, precision, and reliability in parameter estimation for Proton Exchange Membrane Fuel Cells (PEMFCs). RMSE measures the average magnitude of the error between predicted and experimental values, providing a clear indication of the algorithm’s accuracy. The RMSE for each algorithm was calculated using the following formula: \({\text{RMSE}}=\sqrt{\frac{1}{N}\sum_{i=1}^{N} ({V}_{\text{meas}}(i)-{V}_{\text{cal}}(i){)}^{2}}\). where \({V}_{\text{meas}}(i)\) is the measured voltage, \({V}_{\text{cal}}(i)\) is the calculated voltage, and \(N\) is the number of data points. SCPSO consistently achieved the lowest RMSE values across all PEMFC models, demonstrating its superior accuracy. For instance, for the BCS 500 W model, SCPSO achieved an RMSE of 0.02549, compared to 0.05829 for FLA, 0.02569 for HFPSO, and 0.02551 for ESMA. MAE provides a measure of the average absolute difference between predicted and experimental values, offering insight into the algorithm’s precision. The MAE was calculated as: \({\text{MAE}}=\frac{1}{N}\sum_{i=1}^{N} |{V}_{\text{meas}}(i)-{V}_{\text{cal}}(i)|\). SCPSO exhibited the lowest MAE values, indicating minimal deviation from experimental data. For the Horizon H-12 model, SCPSO achieved an MAE of 9.66 * 10^(-17), while FLA, HFPSO, and ESMA yielded MAE values of 0.00142, 0.00010, and 0.00021, respectively. The Correlation Coefficient (R) quantifies the strength of the linear relationship between predicted and experimental values. An R value close to 1 indicates a strong positive correlation. The formula for R is: \(R=\frac{\sum_{i=1}^{N} ({V}_{\text{meas}}(i)-{\overline{V}}_{\text{meas}})({V}_{\text{cal}}(i)-{\overline{V}}_{{\text{ca}}{\text{l}}})}{\sqrt{\sum_{i=1}^{N} ({V}_{\text{meas}}(i)-{\overline{V}}_{\text{meas}}{)}^{2}\sum_{i=1}^{N} ({V}_{\text{cal}}(i)-{\overline{V}}_{\text{cal}}{)}^{2}}}\) . SCPSO consistently achieved R values close to 1 across all PEMFC models, indicating a strong alignment with experimental data. For the Ballard Mark V model, SCPSO achieved an R value of 0.9999, compared to 0.9987 for FLA, 0.9995 for HFPSO, and 0.9998 for ESMA. Efficiency measures the proportion of variance in the experimental data explained by the model. It is calculated as: \({\text{Efficiency}}=1-\frac{\sum_{i=1}^{N} ({V}_{\text{meas}}(i)-{V}_{\text{cal}}(i){)}^{2}}{\sum_{i=1}^{N} ({V}_{\text{meas}}(i)-{\overline{V}}_{\text{meas}}{)}^{2}}\) SCPSO demonstrated the highest efficiency values, indicating its ability to accurately model PEMFC behavior. For the STD 250 W model, SCPSO achieved an efficiency of 99.98%, compared to 99.85% for FLA, 99.91% for HFPSO, and 99.97% for ESMA. The statistical metrics for all algorithms across the six PEMFC models are summarized in Table 5. SCPSO consistently outperformed the comparative algorithms in terms of RMSE, MAE, R, and Efficiency, further validating its robustness and reliability in PEMFC parameter estimation. The statistical analysis confirms that SCPSO is a highly accurate, precise, and reliable optimization tool for PEMFC parameter estimation, outperforming traditional and state-of-the-art algorithms across all evaluated metrics.

Table 5 Statistical metrics for SCPSO and comparative algorithms.

The statistical analysis demonstrates that the proposed SCPSO algorithm consistently achieves the lowest RMSE, MAE, and RE values across all PEMFC systems, indicating superior accuracy and precision. Additionally, SCPSO exhibits the shortest runtime, highlighting its computational efficiency. These results confirm that SCPSO outperforms competing algorithms in terms of both optimization performance and computational speed, making it a robust and reliable tool for PEMFC parameter estimation. FLA and LSMA showed higher RMSE and MAE values, indicating lower accuracy and precision compared to SCPSO. Their efficiency and correlation coefficients were also lower, suggesting less reliable performance. HFPSO and PSOLC performed better than FLA and LSMA but were still outperformed by SCPSO in terms of RMSE, MAE, and efficiency. ESMA, DETDO, and EGJO demonstrated competitive performance, with RMSE and MAE values close to SCPSO. However, SCPSO consistently achieved the lowest errors and highest efficiency, confirming its superiority. The statistical analysis confirms that SCPSO is a highly accurate, precise, and reliable optimization tool for PEMFC parameter estimation, outperforming traditional and state-of-the-art algorithms across all evaluated metrics. This makes SCPSO a promising candidate for real-world applications in energy systems and sustainable energy management.

Conclusions

The study demonstrates the superior capabilities of the Sine–Cosine Particle Swarm Optimization (SCPSO) algorithm for parameter optimization of PEMFC systems. Key findings, implications, and limitations are summarized below:

Key findings

Unparalleled Optimization Performance: The SCPSO consistently produced the lowest Sum of Squared Error (SSE) values for all PEMFC systems tested with the lowest variability, demonstrating its precision and robustness. For all cases, SCPSO ranked first in the Friedman Rank (FR = 1) and outperformed competing algorithms, including HFPSO, LSMA, DETDO, and PSOLC.

Computational Efficiency: Among all tested algorithms, SCPSO showed the shortest runtimes, which makes it very suitable for real time applications.

Experimental Validation: In all PEMFC systems, SCPSO’s predictions of voltage (Vest) and power (Pest) outputs are very close to the experimental data, with average relative errors (RE) as low as 0.052587% in some cases.

Wide Applicability: The algorithm showed consistent performance across six different PEMFC systems, BCS 500 W, NedStack PS6 600 W, SR-12 W, Horizon H-12, Ballard Mark V, and STD 250 W Stack.

The results show that SCPSO provides a reliable, precise, and computationally efficient solution to PEMFC parameter optimization with important implications for improving the efficiency and reliability of fuel cell applications in energy, transportation, and industrial sectors.

The algorithm’s scalability and robustness make it a strong candidate for optimizing larger fuel cell stacks and hybrid systems.

Reservations and limitations

Dependence on Initial Conditions: As is the case with most optimization algorithms, SCPSO’s performance is sensitive to the initial population, which was mitigated by running multiple independent runs.

Scope of Application: The study is limited to PEMFC systems and the analysis to other fuel cell types such as SOFCs remains a future goal.

Computational Complexity for Larger Systems: Although SCPSO is efficient for the tested systems, its computational demands for larger scale or highly complex fuel cell networks require further investigation.

Future work

The implementation of SCPSO in hybrid models with machine learning to make both more adaptive and predictive. Generalizability of the framework is expanded to other fuel cell technologies, such as SOFCs, to validate the framework. The investigation of SCPSO’s performance under dynamic load conditions and multi objective optimization scenarios to deal with real world variability.

Based on its computational efficiency, robust optimization capabilities, and experimental validation, SCPSO is shown to be a benchmark algorithm for PEMFC parameter optimization. These findings are important in advancing fuel cell modeling, optimization, and real world deployment.