1. Introduction
Since the start of the Industrial Revolution, humans began to replace animals with vehicles and ships as their primary means of transportation. However, this rapid technological development was also accompanied by numerous negative effects. In current times, the combustion of diesel and gasoline has resulted in a sharp increase in the amount of carbon dioxide and particulates worldwide. The overexploitation of oil also caused global concerns regarding the resulting economic crises. It follows that there is an utmost priority to find an alternative and cleaner energy source. One such alternative is fuel cells: devices that directly convert chemical energy into electricity. Fuel and oxygen undergo oxidation and reduction in the cell to produce energy, discharging pure water as its only byproduct. Among the numerous types of fuel cells, attention has been drawn largely to proton exchange membrane fuel cells (PEMFCs) due to their high efficiency in energy conversion, quick response time, and capability to operate at room temperature [
1]. PEMFCs are complex systems that possess characteristics of high non-linearity and strong coupling, among others. During operation, their system performance is affected by numerous factors, such as system and environmental temperatures, humidity, current density, and fuel intake pressure. The crux to advancing PEMFC technology lies in the conversion of electrochemical reactions into mathematical equations. Modeling can aid users to quickly understand how to improve on the system performance. More importantly, there is a need to understand how the properties of the PEMFC can be accurately assessed. Currently, there are numerous methods of PEMFC modeling. One such method is mechanical modeling, which involves differential equations or thermal and water management on the electrochemical reactions within PEMFCs [
2], as well as electrochemical reaction properties within the cells. There is also artificial neural network [
3,
4] and support vector machine [
5] modeling, which involves designating a fuel cell as a “black box” in model recognition. However, not only is this method costly and requires a substantial amount of experimental data, it also does not thoroughly clarify the working mechanism within the cell. It is unable to analyze certain system parameters and can only represents the variable relationship between input and output—and thus, poses a hindrance to the design of an optimal system. Another method is semiempirical modeling, a mathematical model based on the PEMFC reaction mechanism [
6,
7,
8]: studies have indicated that these mathematical models constructed by deriving experiment results are highly stable and efficient.
Photovoltaic (PV) cells are a form of alternative energy possessing mature technologies and numerous applications. Their efficacy of use is determined by their current–voltage (I–V) characteristics; therefore, the design of PV cells requires a level of precision in its modeling. PV cells are typically modelled using two steps: by creating a mathematical modeling equation, and getting an accurate estimation of every parameter value. After the parameters of a PV cell under various working conditions are acquired during the modeling process, the maximum power of the cell can then be estimated. Presently, single diode (SD) models are one of the more common models applied to simulate the equivalent electronic circuit in a PV cell [
9,
10]. The parameters to be determined in this model can be calculated through the fitting of the experimental data in the cell.
Generally, methods used for estimating PEMFC and PV cell parameters can be categorized in two ways: deterministic and metaheuristic. Some examples of deterministic methods include the least square method [
11], Lambert W functions [
12], and iterative curve fitting [
13]. An advantage of such methods lies in their speed in yielding estimation results, but one disadvantage is also that their calculated solutions are highly sensitive to initial solutions and often lead to local optima.
Metaheuristic algorithm is an advanced process which guides a subordinate heuris-tic by balancing exploitation and exploration. The former assures the searching of optimal solutions within the given region, and the latter makes sure the algorithm reach different promising regions of the search space. In addition, the metaheuristic algorithm is classi-fied into four subcategories, including evolutionary algorithms [
14], physics-based algorithms [
15], swarm-based algorithms [
16], and bio-inspired algorithms [
17]. These algorithms are widely applied to solve complex problems in various domains. For example, studies that are related to online learning [
18], scheduling [
19], multi-objective optimization [
20], vehicle routing [
21], medicine [
22], data classification [
23], energy system [
24,
25], etc. can find the footage of the usage. This study, on the other hand, selected swarm-based algorithms to optimize the energy systems. Swarm Intelligence (SI) is known as “the collective behavior of decentralized, self-organized systems, natural or artificial” [
26]. Several types of swarm optimization algorithms have been recently proposed for use in solving problems regarding PV cell parameters. Several types of swarm optimization algorithms have been recently proposed for use in solving problems regarding PV cell parameters. In other literatures, some swarm optimization algorithms that have been employed to estimate PV cell parameters include particle swarm optimization (PSO) [
27], artificial bee colony [
28], and whale optimization algorithms [
29]. Such algorithms typically yield more satisfactory estimation results than deterministic methods. In particular, PSO, which is based on birds’ foraging behaviors, is highly efficient in calculation. Although the original PSO has been applied to solve various optimization problems, it possesses the problem of possible premature convergence—a common characteristic found in other basic swarm intelligence algorithms. In this study, three types of improved PSO algorithm, namely inertia weight PSO, compressed PSO, and momentum PSO, were employed in PEMFC parameter optimization.
In the following section will introduce PEMFC and photovoltaic (PV) cell mathematical modules and the used heuristic algorithms. Three algorithms are employed to find the parameter of a benchmark of PEMFC and PV cell model by minimizing the sum of squared errors (SSE) and root means square errors (RMSE) between the measured and estimated voltage. After 30 independent runs, the algorithm are compared in terms of the fitness values.
2. Proton Exchange Membrane Modeling and Theory
Hydrogen fuel cells are currently a very well-received form of green power system. The system operates by feeding hydrogen gas into the anode before it is broken down using a catalyst. Thereafter, the electrons form a circuit through the external circuit connection load. Hydrogen ions then travel to the cathode through proton exchange membranes, forming water with oxygen ions. This mechanism allows for low-pollution emissions:
The theoretical voltage value for system modeling is calculated using the Nernst equation in accordance to the chemical energy and battery electrode potential. The Nernst equation was first proposed by the German chemist Walther Hermann Nernst [
30] to determine the electromotive force in electrochemical cells. Under the standard condition with an environmental temperature of 298.15 K and atmospheric pressure of 1 atm, the standard electrode potential is 1.229 V, with F being a Faraday constant of 96,485 As/mol, and n representing the number of electrons per unit mole during the chemical reaction in a cell [
31,
32,
33]:
In the above equation, the value of 1.229 indicates the ideal electric potential energy under the standard condition,
T represents cell temperature, and
PH2 and
PO2 each represents the effective partial pressure of hydrogen and oxygen, respectively. If H
2 and O
2 are the reactants, then the partial pressure can be calculated using Equation (5) and (6); however, if the reactants are H
2 and the air, the effective partial pressure of P
O2 must then be calculated with Equation (7) [
31]:
The variables
Pa and
Pc represent the inlet pressure at the anode and cathode respectively, while
RHa and
RHc represent the relative humidity of the steam at the anode and cathode, respectively. Next, I represents the working current of the cell and
A represents the effective area of the membrane. Lastly,
PH2O indicates the saturation pressure of water vapor as a function of cell temperature
T, as expressed in Equation (8):
One must note that voltage loss can result from cell polarization, leading to a loss in potential and the inability of cells to operate at the ideal voltage. Cell polarization can occur in three ways: activation polarization, Ohmic polarization, or concentration polarization [
34]. The polarization of PEMFC shown in
Figure 1.
Activation polarization (
Vact) is a reaction that occurs on the electrode surface—a delay in electrochemical reaction causes potential drift, largely due to catalyst adsorption and desorption. The main factor that affects activation polarization is the reaction of the cathode.
Vact can be calculated using a semiempirical equation, as shown below in Equation (9):
In the Butler-Volmer equation, which has its basis in kinetics, thermodynamics, and electrochemistry, the semiempirical coefficients ξ
1 to ξ
4 bears physical significance. Also, the concentration of dissolved oxygen catalyzed at the cathode (C
O2) can be calculated using Henry’s law, as expressed in Equation (10):
Ohmic polarization occurs when energy is expended as the current passes through components of the fuel cell. The key reason for this is internal resistance, which is generated through multiple aspects: firstly, the resistance of hydrogen ions during their transmission through the proton exchange membrane, the resistance during the transmission of electrons, and the resistance caused by gaps in the contact surfaces between cell components. In particular, the resistance encountered by hydrogen ions during their transmission through the proton exchange membrane is the primary cause of Ohmic polarization, as denoted in Equation (11):
Rc is usually regarded as a constant due to the relatively narrow range of the PEMFC working temperature. In order to encompass all the major membrane parameters,
Rm is expressed in the following universal equation:
l denotes the thickness of the membrane and
ρm represents the specific resistivity of hydrated proton flow, which can be expressed by an empirical formula such as Equation (13). In the equation,
λ is an adjustable parameter, while 181.6 ⁄ ((
λ − 0.634) is the specific resistance value with no current and at the cell temperature of 30 °C. Meanwhile, the term ‘exp’ in the denominator represents the temperature correction item when the cell is not 30 °C. Following the effective water content of the exchange membrane (
λ), 3(
i/
A) is a correction item in the experiment that represents the effects of current density and cell temperature on the average water content of the membrane.
Concentration polarization refers to the potential loss caused by the mass transfer limitation of the reactant. This is primarily due to a high current load—when a fuel cell generates electricity, the reactants near the electrode continues to be depleted. Following that, if the reactant transfer rate is not sufficiently high enough to meet the reaction efficiency requirement, the concentration of reactants in the reaction zone will decrease and lead to a potential loss. To express this decrease in concentration (
Vcon), the limiting current density corresponding to the maximal power supply speed (
Jmax) and the coefficient determined by the type and working condition of the cell (
B) are defined in the empirical Equation (14) below:
In general, the voltage loss in a low current density is caused by activation polarization. However, as the current density increases, ohmic polarization becomes the primary reason for voltage loss. It follows that when there is a high current density, the main cause for the loss will due to concentration polarization instead. The value of the fuel cell’s theoretical output voltage is the same as its open circuit voltage. When the system exports a current for external work, polarization occurs. The relational equation of the cell is expressed in Equation (15), where the voltage loss caused by the three polarization effects is subtracted from the theoretical stack voltage, before multiplying it by the number of cell stacks (
ncell):
Objective Function of the Optimized PEMFC Model Parameters
In Equations (4)–(15), the measurable operation parameters
T,
Pa,
Pc,
RHa,
RHc,
,
, and
ncell are determined by the operation environment, whereas the physical parameters
ξ1,
ξ2,
ξ3,
ξ4,
λ,
Rc, and
B are unknown parameters. Taking in consideration that the unknown parameters X = (
ξ1,
ξ2,
ξ3,
ξ4,
λ,
Rc,
B) will considerably affect the model calculation results, these unknown values must thus be estimated as accurately as possible to fulfill the actual I–V characteristic. Nevertheless, before X = (
ξ1,
ξ2,
ξ3,
ξ4,
λ,
Rc,
B) is identified, the objective function needs to be defined. In this study, the objective function
F(
X) is to find a set of optimized parameter values so as to minimize the sum of squares for errors (SSEs) between the experimental voltage (
Vexp) and the estimated voltage that was calculated using the aforementioned equations (
Vmod), as expressed in the equation:
In Equation (16), g represents the number of data sets used for parameter extraction, N represents the number of experimental I–V data in each data set, and LB and UB are the lower and upper limits of the known model parameter X, respectively.
3. Photovoltaic Cell Modeling and Theory
Photovoltaic Cell converts light into energy due to the photovoltaic effect of semiconductors. The single-diode model represents the non-ideal single-exponential diode model [
13]. The equation related to this model is relatively simple and can be expressed in the form of an equivalent circuit, as shown in
Figure 2. This model displays a diode used as a shunt to divert the photogenerated current (
Iph), and a resistor which is connected in series to the diode.
As shown in
Figure 2, the SD PV cell model has a current source that is connected in a parallel with a diode [
13,
35]. Under light, an actual PV cell exhibits series and shunt resistance. The terminal current (
It) for the PV cell in the model can be expressed as follows:
In the above equation,
Iph represents the source of photoelectric/photogenerated current,
Id represents the saturation current of the diode, and
Ish represents the leakage current caused by the shunt resistance,
Rsh. In this study, the Shockley diode equation was adopted to produce a suitable model, where the relational equation between the current (
Id) and voltage (
Vt) can be expressed as follows:
Consequently, Equation (19) can be formulated:
In Equation (19),
Vt represents the terminal voltage,
T represents the cell temperature, the charge of the electron is q = 1.602 × 10
−9 (C), and the Boltzmann constant is k = 1.380 × 10
−23 J/K. It can be seen that the nonlinear Equation (19) contains several unknown parameters—accordingly, the SD model has the following five parameters to be determined: photogenerated current (
Iph), reverse saturation current (
Isd), ideal factor for the saturated diode (
n), series resistance (
Rser), and shunt resistance (
Rsh). These parameters can be estimated using the I–V equation of the PV cell. To accurately obtain the unknown parameters X = (
Rser,
Rsh,
Iph,
Isd,
n), IV curve of solar cell uses root mean square errors (RMSEs) Equation (20) and is identified by minimizing the errors between the experimental voltage and the estimated voltage as the optimization principle.
4. PSO Algorithm
As compared to other swarm intelligence algorithms, PSO stands out as one that is not only highly efficient, but also does not require much memory space in its calculation. The algorithm, which is based on birds’ foraging behaviors, adjusts the speed of particles to alter their positions and conducts multiple searches to identify their optimal positions [
36]. These equations are expressed in Equations (21) and (22), and
Figure 3 depicts a schematic diagram of the particle search. A basic PSO search uses the optimal positions identified through an individual particle’s and combined particle swarm’s current search results to determine the direction of the subsequent search target, in order to quickly attain a convergent solution:
In Equations (21) and (22), and represent the position and speed vector of the ith particle respectively, pbesti represents the previous optimal position of the ith particle, and gbest represents the optimal position of the particle swarm Np when it evolves to the kth generation. The parameters in Equation (21) also include cognitive (c1) and social (c2) learning rate, which are generally set as c1 = c2 = 2.0.
As a result of not being able to necessarily identify the global optimal solution through referencing a current local optimal solution, it can be easy to fall into the trap of being too preoccupied by the local optimal solution found. In 1998, Shi and Eberhart proposed an improved PSO algorithm [
37], in which they introduced a weight parameter (
w) to control the algorithm’s search speed, thereby reinforcing its local search ability. This improved algorithm is termed inertia weight PSO and has been verified to have a greater efficacy than a genetic algorithm. Weight (
w) serves as a critical parameter in the algorithm’s search for the optimal solution—the value of which can be solved linearly by setting two weight values,
wmax = 0.9 and
wmin = 0.4, according to the number of iterations. The inertia weight PSO is expressed as follows:
Furthermore, in 1999, Clerc proposed a PSO algorithm with a constriction factor (K) [
37] that can effectively dampen the speed of particles to enhance their local search capacity. The improved algorithm, referred to as constriction PSO, has been verified to significantly reinforce the particles’search capability in a local spatial setting. After running a stability analysis, the method proposes that K is a function of φ = c
1 + c
2. When compared to the previously mentioned inertia weight PSO that was proposed by Shi and Eberhart, the constriction PSO produces better solutions and reduces the need for manual inputs with regards to the weight parameter (
w). Moreover, both the cognitive learning rate (c
1 and c
2) can be set to the same value of 2.05. Constriction PSO can be expressed in the following equations:
In the equations, φ = c
1 + c
2, and φ > 4. The momentum PSO [
38], which has been improved upon in recent years, generates the following equations in accordance with the physical characteristics of particle flight:
β is a positive momentum constant (0 ≤ β < 1) that controls the rate of change in particle speed vectors, while another momentum constant, α, is used to adjust the rate of change in particle positions. These aforementioned equations grant each particle, when searching for an optimal solution at different times, the capability to dynamically adjust itself. In this study, β is set to the value 0.1 and α is set to the value of 1.0. When the entire system is in a state of equilibrium (i.e., no better particle positions are detected; and , (29) automatically fulfills , yielding ). An empirical analysis confirmed this algorithm to have satisfactory calculation efficiency and problem-solving accuracy.