1. Introduction
The increase in renewable energy system production has increased the necessity of using battery storage systems to meet energy demand and production. Recent advances in low-carbon and sustainable batteries have given lithium-ion batteries a key role in decarbonizing energy production [
1,
2,
3]. The increasing global demand for clean and sustainable energy sources has rapidly accelerated the development and deployment of storage systems like lithium-ion batteries, along with other energy storage systems for various applications [
4], including electric vehicles, portable electronics, and large hybrid renewable energy systems, and the need for research on improving energy storage systems performance [
5,
6]. The widespread adoption of lithium-ion batteries can be attributed to their high energy density, long cycle life, and relatively low self-discharge rate, making them a very suitable technology for electric vehicle and mobile electronic device applications [
7] or even it can be used in big systems to provide energy in a viable way. Additionally, the increasing environmental concerns and international regulations have further contributed to the popularity of these batteries as a means of reducing greenhouse gas emissions as they can be integrated into microgrids based on hybrid renewable energies as a promising energy storage system [
8,
9], not only to make use of electricity as final energy but also for heating systems such as the one proposed by the authors in [
10] where they study a microgrid topology with a storage system based on traditional batteries; however, they found significant challenges in terms of the use of conventional batteries. However, storing energy in batteries is a very effective way for later use [
11,
12] compared to other methods. As a result, there is a growing need for accurate and reliable models to predict the performance and lifetime of these batteries, which are essential for optimizing their performance, ensuring their longevity, improving safety, and using metaheuristic methods to estimate their operative parameters and performance improvement [
13].
The complexity of the electrochemical and thermal characteristics of lithium-ion batteries makes developing robust models a very challenging task [
14]. Various battery modeling approaches have been proposed in the literature to simulate lithium-ion battery response, including electrochemical models [
15], thermal models [
16], and electrical circuit models [
17]; an essential task of battery models is to provide effective state-of-charge (SOC) estimations since this is a crucial parameter that may affect not only system efficiency but also economic constraints. The work developed in [
18] presents an innovative AdaBoost-BPNN (Back Propagation Neural Network) model to enhance the precision of SOC estimation in lithium-ion batteries; the model outperforms traditional methods, as shown in [
19], by applying artificial neural networks to a linear regression model. However, the proposed methods lack a detailed exploration of parameter optimization and applicability across diverse battery types.
The electrochemical models offer a detailed understanding of batteries’ chemical and electrical reaction mechanisms, but are often computationally expensive and time-consuming [
20]. On the other hand, thermal models are essential for predicting temperature variations and managing thermal issues during battery operation [
21]. However, these models may not wholly understand the electrochemical processes inside the battery. Besides SOC estimation, a practical battery model may also give insights into the thermal performance of the batteries to design an effective battery management system (BMS) [
22,
23]. Recently, electrical circuit models have gained popularity due to their computational efficiency and their ability to integrate electrochemical parameters to predict battery behavior under various conditions, such as temperature changes and charge/discharge cycles, as the authors presented in [
24], where the system is modeled using MATLAB/Simulink version 2023a. The developed model has various applications, such as characterizing new lithium-ion batteries. In recent years, advancements in computing technology have enabled researchers to explore new approaches for modeling lithium-ion batteries by incorporating machine learning and artificial intelligence techniques [
25]. These new approaches have shown promising results in improving battery models’ accuracy and reliability, especially when combined with traditional modeling techniques [
26]. Furthermore, data-driven techniques have also been employed to develop empirical models based on experimental data, offering a faster and more efficient alternative to traditional classic physics-based models [
27].
In the context of recent research on lithium-ion battery modeling, optimization algorithms play a crucial role in tuning the model parameters to improve the accuracy and performance of the battery’s models [
28]. Several optimization techniques have been employed, including gradient-based optimization [
29], genetic algorithms [
30], and swarm intelligence-based algorithms. Among these algorithms, Particle Swarm Optimization (PSO) [
31,
32] and Grey Wolf Optimizer (GWO) [
33] have emerged as promising tools for optimizing model parameters in lithium-ion battery modeling. These algorithms have demonstrated their effectiveness in various engineering applications [
34], showing their efficiency in the adjustment of system parameters, as in [
35], where several bio-inspired optimization methods were applied and compared for the design of optimal Maximum Power Point Tracker—Proportional-Integral-Derivative (MPPT PID) controllers for renewable energies, showing a better performance than classical methods. They, therefore, can potentially improve the accuracy of lithium-ion battery models [
36]. However, there is limited research comparing the performance of PSO and GWO in the context of lithium-ion battery modeling and simulation [
37].
Given the importance of accurate and reliable lithium-ion battery models for various applications, this paper aims to present a comparative study of PSO and GWO applied to a proposed lithium-ion battery model and compared it to an experimental model. This model combines mathematical equations and electrochemical experimental data, complemented by representation through an equivalent circuit. This model was adapted to an RC circuit with the ability to simulate electrochemical features such as SOH and temperature inside the cell. These parameters will be validated in future work with experimental results.
The primary objective is to optimize the parameters and reduce the root mean square error (RMSE) between the battery’s simulated and experimental current outputs. To achieve this, a model that integrates electrochemical parameters into an electrical circuit to estimate the behavior of the battery under different conditions is developed, considering temperature changes and charge/discharge cycles. The model is implemented using MATLAB/Simulink [
38], and the optimization results are evaluated based on the reduction of the RMSE from the optimized models compared to the not optimized and the experimental model, optimization algorithm convergence, and computation time as well as electrical parameter estimation.
2. Methodology
This section describes the methodology for developing the proposed lithium battery model and its improvement using optimization algorithms. The methodology is shown in
Figure 1. As can be seen in the mentioned figure, the methodology starts with a literature review and model development. The proposed battery model is a “synthetic” model since it is based on experimental data and reported results from different authors [
39,
40,
41,
42]. The proposed battery model is based on an equivalent hybrid electrical circuit model, which includes the development of electrical and electrochemical equations. After the battery model was obtained, the model was optimized by implementing the PSO and GWO optimization algorithms to find the best combination of the proposed equivalent electric circuit of the model. For the validation stage of the methodology, the model was validated using experimental data and compared to the PSO- and GWO-improved models.
2.1. Lithium-Ion Battery Selection
The Panasonic model NCR18650B battery was chosen for the development of the proposed lithium battery model. This battery is widely used in laboratory studies due to its low cost, availability in the market, and ease of obtaining measurable parameters of interest, such as current, voltage, temperature, and state of charge.
For the developed model, electrochemical and electrical characteristics were considered. The thermal and electric characteristics reported in related works from lithium batteries were considered and integrated into an electrical circuit model.
It is essential to emphasize the significance of the study in the mathematical modeling and equivalent circuits of a lithium-type battery.
Within the realm of computational analysis, this study highlights the identification and integration of parameters into equivalent circuits. To achieve this, understanding the experimental parameters is crucial. Panasonic NCR18650B is a rechargeable lithium-ion battery extensively employed in various electronic devices and research projects in energy and storage topics.
The essential features of the Panasonic NCR18650B lithium battery are as follows:
Battery capacity and voltage: The Panasonic NCR18650B is well known for its high nominal capacity of approximately 3400 mAh and a nominal voltage of 3.6 V. These features make it perfect for applications that require extended battery life.
Research usage: Battery research often involves analyzing battery parameters, such as capacity, voltage, internal resistance, and cycle life. Lithium-ion cells are commonly studied using batteries similar to Panasonic NCR18650B, which is a reliable battery that can assess performance and durability.
Battery test methodologies: In research studies, specific tests can be conducted to better understand a battery’s behavior under various conditions. These tests include charge and discharge cycles, internal resistance tests, electrochemical impedance spectroscopy (EIS), and aging analysis.
Specific NCR18650B characteristics: It is important to note the specific characteristics of NCR18650B in a research study. This may include details about its actual capacity, behavior during charge and discharge cycles, internal resistance at different charge states, and other electrical and physical parameters.
Safety considerations: It is crucial to follow safety practices during battery testing, which include monitoring temperature, preventing short circuits, and using appropriate testing equipment designed for batteries, as lithium-ion batteries can be sensitive to extreme conditions.
Table 1 below presents different authors’ parameters and experimental methodologies for constructing the proposed battery model.
2.2. Electrical Model
The methodology used incorporates electrochemical modeling to investigate redox processes within a cell, allowing for the analysis of these events experimentally and analytically. As these electrochemical processes are examined more thoroughly, their complexity increases, posing challenges for effective modeling. One such complexity is the influence of temperature, which depends on heat generation, energy balance, and cooling processes under different conditions.
Heat transfer in a battery is typically unstable, varies over time, and is determined by an internal heat source. It is necessary to establish the operating conditions and the technical limits of the batteries to choose heat generation modeling; this leads to carry out and energy balance [
43]. Heat generation depends on the state of the battery and the entropy process of the cell, which is specific to the electrochemical reactions performed. The cell’s total transfer and phase heat were relatively small, allowing the entropy heat to be equivalent to Joule heat. Assuming there is no heat exchange with the exterior, the basic form of the battery’s heat capacity is given by [
44,
45], as shown in Equation (1).
where
q is the heat generation rate by the battery,
is the current in the battery,
is the measured amount of voltage (terminal voltage),
is the open-circuit voltage,
is the cell temperature, and
is the entropy heat coefficient. This dynamic behavior has allowed for deeper thermal modeling of batteries, starting with the early models developed by Pals and Newman, who conducted various tests and conditioned thermal models for lithium polymer batteries.
Heat transfer processes in batteries are typically transient and time dependent, with an internal heat source driving them. The proposed methodology considers batteries’ operating conditions and technical limitations, enabling energy balancing.
Some electrochemical models with thermodynamic tendencies use the experimental characterization of commercial cells to analyze the three-dimensional behavior of heat transfer and how it affects the charge and discharge of the battery in its electrochemical components, such as its anodes, cathodes, and electrolytes. The presented work used experimental data to model the lithium-ion battery model effectively.
2.3. Proposed Hybrid-Electrical Model
The proposed model considers that specific parameters change over time, resulting in a dynamic open-circuit voltage (V
OC) as the state of charge (SOC) varies. A diagram of the proposed electrical model is shown in
Figure 2. IBAT is the current. The model was validated in two scenarios, at different load ratios from 0.5 A to 5 A in increments of 0.5 A and constant temperature, and at different temperature values from −20 to 60 °C in increments of 20 °C and constant load ratio, to observe the model’s behavior under different operation conditions.
Despite being considered simple, it is possible to integrate electrochemical equations into the results of RC models with two arrays. These equations relate the open-circuit voltage (VOC) to the temperature change inside the cell. Additionally, based on these data and considering the charge or discharge current, equations were developed to estimate the health status. Experimentally, these two characteristics are usually obtained with high-quality and expensive sensors. The idea of using this model in future work is to better understand the behavior of a battery with relationships such as charging from renewable sources and non-constant discharges. This highlights the need for it to be more accessible to adapt to these variables.
The proposed model is based on other related word experimentation results implemented to determine the battery’s primary characteristic curves, allowing for the analysis and development of a model that approximates experimental data and identifies critical points in battery behavior. For this model, a compilation of experimental data from various authors (mentioned in
Table 1) was carried out. With these parameters, a hybrid model was developed for implementation in a virtual battery. It is worth noting that the data and methodologies provided by these authors were respected, and all data used were already noise-filtered by the source. Battery manufacturers provide useful parameters for modeling real-time battery behavior approximations. Understanding specific critical points of the battery enables improvements in the model through optimization techniques.
Figure 3 illustrates the principles applied in formulating the equations for this model. The equations were formulated after identifying the main dependent and independent variables and parameters involved in lithium-ion battery dynamics. The proposed model acknowledges that specific parameters exhibit variations over time when dealing with a lithium-ion battery. Consequently, features like state of charge undergo fluctuations, introducing dynamism to the open-circuit voltage (V
OC).
The SOC and V
OC relationship characterization curve can be analyzed from the technical data sheet of batteries, which provides a linear zone as part of the proposed basic model. Equation (2) shows the relation between V
OC and SOV, making the battery model nonlinear. This nonlinearity is emphasized by incorporating equations of electrochemical phenomena, which are linked to ambient temperature and their interaction with electrical devices, both for charging and discharging. Thus, a hybrid model is established, primarily governed by Equations (2)–(7).
where
is the relationship between the capacity
and a determined experimental time, and
refers to the amount of current used for charging/discharging. Components such as an
array (
,
: resistance and capacitance corresponding to the short transient;
,
: resistance and capacitance for the long transient) and their interaction with the current as the output voltages in the short and long transient,
and
, respectively.
and
are the total voltage for short and long transients.
This model considers open-circuit voltage behavior and exhibits voltage short and long transient stages, expressed in Equations (2)–(4). The overall voltage behavior is the relationship between the three functions in Equation (5).
The battery behavior can be better described due to its interaction with SOC, V
OC, and transient components. This allows for establishing a function for the cell mass temperature, considering the experiment’s ambient temperature as a reference. This function is described in Equation (6):
This data interacts with the
, and if it presents a value greater than 1, it is considered an overload, indicating a possible battery failure. When graphed, it also shows the point at which the battery begins to damage due to the stress provided by each charging and discharging cycle. This relationship is based on open-circuit voltage, and the terminal voltage (
) is also affected consequently. The relationship between both yields the battery’s state of health (
), expressed in Equation (7):
Another option to find
is the relationship between the battery’s maximum capacity, differential capacity, and discharge depth. To obtain this equation, it is necessary to solve polynomials for treatment and find the battery capacity dynamically, with coefficients δ (−0.025) and φ (1.05). This is expressed in Equation (8):
An equivalent circuit model was developed to estimate the battery’s behavior under different operating conditions. This model was based on the Randles circuit model, which consists of a resistor () in series with a capacitor () and a constant-phase element () that represents the double-layer capacitance of the electrodes. The model also includes a Warburg impedance element to account for the diffusion process in the battery.
By utilizing the change in SOC behavior over time and the charging-discharging stages of the battery through experimental time, an equation can be established to predict the number of battery cycles (
Ncycles), as presented below:
where
is a predetermined charging/discharging profile.
Faraday’s electrochemical law establishes a relationship between Gibbs’ free energy and the energy obtained from the system. Consequently, a “damage” point can be found in each transient stage due to the aging of materials and the number of charging and discharging cycles, leading to variations in the battery’s output capacity. Equations (2) and (5) describe the general battery behavior concerning voltage and time.
The simulation in this work was performed using MATLAB software version 2023a with the Simulink tool due to its ease of use with electrical parameters. The model is based on two separate circuits connected by controlled voltage and current sources. The first circuit describes the charging and discharging of the batteries in Equations (5)–(7), and the second circuit describes the transient behavior in Equations (3) and (4).
Dynamic cell behavior should be analyzed using high-end devices through experiments. Experimental methodologies allow for the study of the electrochemical behavior of materials and their interaction with the environment. However, these methods are costly and have limited forecasting capabilities based on the data.
2.4. Optimization Algorithms
Two bio-inspired optimization algorithms were employed to optimize the parameters of the developed battery model: Particle Swarm Optimization (PSO) and Grey Wolf Optimizer (GWO).
Particle Swarm Optimization (PSO): The Particle Swarm Optimization algorithm is inspired by the collective behavior observed in various animal species searching for resources within their surroundings. PSO represents search agents as particles within a swarm, each characterized by its position, velocity, and acceleration rates within a search space. Initially, multiple particles are distributed throughout the search space, potentially containing the global optimization problem solution. The objective function must be assessed and minimized to identify a global solution.
The particles’ positions, velocities, and accelerations are updated every iteration to converge toward the global solution. A fitness function is computed for each particle, and the optimal fitness function value among all particles is considered the global best. Each particle’s personal best fitness function value is updated throughout the iterative process. The particles’ velocities are accelerated towards the global best solution and each particle’s personal best solution in each iteration. As iterations progress, the particles’ velocities are accelerated towards the global best and personal best solutions, as described in Equation (11).
In the previous equation, represents the velocity of the i-th particle in the j-th dimension while signifies the position of the i-th particle in the j-th dimension. denotes the personal best position of the i-th particle in the j-th dimension and stands for the global best position in the j-th dimension. The inertia weight is represented by w, whereas and are the acceleration constants. Additionally, and are random numbers ranging from 0 to 1. The following is the pseudocode of the PSO algorithm:
Assign random positions and velocities to particles within the exploration space.
Determine the fitness of each particle by utilizing the objective function.
Refresh the personal best position and fitness for every particle.
Update the swarm’s global best position and fitness.
Utilize Equation (1) to modify the velocity and position of each particle.
Repeat steps 2 through 5 until a termination condition is satisfied (for example, the maximum number of iterations is reached, or the desired fitness level is attained).
Grey Wolf Optimizer (GWO): In nature, grey wolves display a distinct hierarchical structure within their packs, typically comprising 5 to 12 wolves. Within this hierarchy, a dominant alpha wolf leads the pack, with secondary beta wolves following, then subordinate delta wolves, and ultimately the follower omega wolves. The GWO-based optimization process is carried out through three primary phases that emulate the hunting behavior of grey wolves in their natural habitat, encompassing encircling, hunting, and attacking.
Encircling phase:
In this phase, every wolf adjusts its position within the search space according to the best relative position to the prey, as identified by the alpha wolf. The prey’s encirclement and herding behavior are mathematically represented using Equations (11)–(14).
The previous equations mathematically depict the encircling and herding behavior of the prey, in which vector alpha signifies the best relative position to the prey, is a coefficient, , C, and are vectors. The vector denotes the prey’s position, vector represents the position of the wolf, stands for the current iteration, and and are values randomly generated between zero and one. Furthermore, the value of vector a decreases linearly in accordance with the iterations.
Hunting stage:
In the hunting stage, the positions of the wolves are updated according to their proximity to the prey. The wolf closest to the prey assumes the role of the alpha wolf, while the beta and delta wolves are designated based on their respective distances to the prey. Equations (15)–(17) depict the updating process of the wolves’ positions.
In these equations, represents the wolf with the most favorable position relative to the prey, denotes the current iteration number of the GWO algorithm, is a random number ranging from zero to one, and encapsulates the encircling effect.
Attack stage:
During the attack stage, the wolves aim to minimize their distance to the prey prior to initiating an attack. The prey, in this context, refers to the optimal global solution of the optimization problem, symbolized as vector
in Equation (18). The vector
features a decreasing
coefficient that depends on the iteration number and reduces linearly in accordance with Equation (18).
The pseudocode of the GWO algorithm used in this work is shown below:
Initialize a population of wolves with random positions within the search space.
Initialize alpha, beta, and delta positions.
Set the iteration counter e = 1.
Evaluate the fitness of each wolf in the population.
While e ≤ MaxIteration, execute the following steps:
- 5.1
Update the search agents’ positions using the encircling prey and hunting mechanisms.
- 5.2
Update each wolf’s position based on the current positions of the alpha, beta, and delta wolves.
- 5.3
Calculate the distance factors (, , ) for each wolf.
- 5.4
Update the positions of the wolves based on the distance factors and the random exploration factor.
- 5.5
Evaluate the fitness of each wolf in the population.
- 5.6
Update alpha, beta, and delta positions based on the fitness values of the wolves.
- 5.6.1
If a wolf has better fitness than alpha, it becomes a new alpha.
- 5.6.2
If a wolf has better fitness than beta but worse fitness than alpha, it becomes a new beta.
- 5.6.3
If a wolf has better fitness than delta but worse fitness than alpha and beta, it becomes the new delta.
- 5.7
Increment the iteration counter e by 1.
End while.
Return the best solution found: the wolf with the best fitness function value is considered the solution to the optimization problem.
To compare the performance of the PSO and GWO algorithms, the root mean square error (RMSE) between the simulated and experimental current outputs of the battery was used as the objective function. The optimization process was carried out using the MATLAB version 2023a Optimization Toolbox, and the performance of the two algorithms was evaluated based on the reduction in the RMSE.
2.5. Model Validation and Performance Assessment
The developed battery model consists of two interconnected circuits with voltage control and a current source. The first part of the circuit, represented by Equations (6)–(8), corresponds to the charging/discharging process of the battery, while Equations (4) and (5), from the above methodology section of this paper, describe the behavior of the transients within the battery. The model incorporates electrochemical parameters as part of the electrical components, allowing for estimation of the battery’s behavior and comparison with experimental results by calculating the root mean square error within the battery current.
The selected battery for experimentation was the Panasonic NCR18650B model, designed for use in electric vehicle packs and other electric mobility applications, such as in airplanes. The open circuit voltage and SOC of this battery are presented in
Table 2.
The experimental parameters for R
TS, C
TS, R
TL, and C
TL were obtained through experimentation and analysis of the literature. For the model developed in this work, the following heuristic values were used, as presented in
Table 3.
The presented parameters are useful for forecasting the loading and unloading stages. Through analysis of the temperature parameters, some systems can be adapted to estimate the battery’s behavior correctly. This is because, when certain peaks of changes in behavior are determined, the phenomenon or some consequences that the battery would suffer can be predicted.
The presented parameters in
Table 4 offer a reliable way of forecasting the battery’s charge and discharge stages. By analyzing the temperature parameters, the behavior of the battery can be correctly estimated, especially when determining the peaks of load changes. This could lead to the development of systems that can detect such peaks and adjust accordingly, thereby improving the safety and performance of lithium-ion batteries.
To evaluate the algorithm’s performance, the Root Mean Squared Error (RMSE) is used as the output of the objective function. The RMSE is measured between the current delivered by the battery over time and the current estimated by the synthetic model optimized by both the GWO and the PSO. Equation (19) shows the RMSE as an objective function.
The optimization vector for the algorithms is constructed by the variables of the proposed hybrid model, represented by X in Equation (20).
The lower bound (LB) and upper bounds (UB) of the values used for each variable of the X vector are shown in Equations (21) and (22), respectively.
The values expressed in Equations (21) and (22) for the limits of each variable of the X vector of Equation (20) are based on values commonly used for this type of model.
Since the proposed hybrid model is an electrochemical equivalent of a real battery, the combination of the X values will result in a better or worse model measured as a function of the RMSE with respect to the experimental control measurements.
3. Results and Discussion
This section presents an analysis of the outcomes derived from evaluating the proposed hybrid-electrical lithium-ion battery model and a comparative assessment of the Particle Swarm Optimization (PSO) and Grey Wolf Optimizer (GWO) models. The objective is to gain insights into the performance and accuracy of each model in predicting battery current and voltage. The analysis is based on the root mean square error (RMSE), optimization algorithm performance comparison, and battery model outputs.
3.1. Comparison of PSO and GWO Algorithm Performance
Optimization algorithms play an essential role in tuning the parameters of the battery model to improve its accuracy and performance. This study compared two bio-inspired optimization algorithms, PSO and GWO, regarding their performance in optimizing the parameters of the developed battery model. The comparison was carried out using the RMSE as the objective function, algorithm convergence, and performance comparisons; the results show that both algorithms effectively optimized the model’s parameters and improved its accuracy.
After the simulations were run, the GWO algorithm outperformed the PSO algorithm regarding the convergence rate and computational time. The convergence curve of the best GWO and PSO is shown in
Figure 4.
In
Figure 4, it can be observed that, although the objective function values are very similar, the convergence speed of the GWO is generally faster towards the global optimum of the problem. In
Table 5, the performance results of each algorithm applied to the lithium battery model are presented in detail.
Given that each optimization problem is unique, the corresponding search space will possess a distinct topology and, consequently, different local optima where an optimization algorithm may be trapped. It is, therefore, important to ensure the convergence of optimization algorithms while averting local optima. The initial step to secure convergence for an optimization algorithm in a problem with an unknown search space topology involves preliminary exploration of potential solutions by testing the diverse configuration parameter values of the optimization algorithms to be used.
This process includes varying both in magnitude and in combination the different configuration values of each algorithm. Then, a comparison is made between the results, considering computation time, number of iterations, and value of the fitness function as indicative of the speed of convergence of the algorithm, and, therefore, its ability to avoid being trapped in local optimums.
Once the adjustment parameters have been identified, within whose values the best objective function value has been obtained, it can be considered that better algorithm convergence under those conditions is assured.
Table 5 details the initial exploration of the different configurations for this study’s PSO and GWO algorithms.
As can be seen in
Table 5 above, the values of the evaluated objective function converge in values between 131 and 132 and a total number of function evaluations between 247 and 1277 for the different configuration parameters of the optimization algorithms evaluated. It is important to note that in optimization, the number of evaluations to a model or objective function per iteration is not a fixed value, so each iteration in the same optimization run can have a different number of evaluations to the objective function. This depends on the algorithm’s convergence characteristics and the particles’ initial position in the search space. That is why, in
Table 5 above, differences are observed between the number of iterations and the number of evaluations for each run. A lower value of the function indicates a better configuration of the algorithm. An analysis of algorithm execution time as the population sizes of the PSO and GWO vary can give insights about the computational complexity of each algorithm. It is remarkable how, when the population increases, so does the execution time. For the PSO algorithm, the increase in computational time for a population of 10 to 1000 suggests nonlinear growth, approaching a polynomial complexity on the order of O(n
k) where k > 1. Similarly, the GWO shows an increase in execution times for larger population numbers, suggesting a polynomial complexity potentially of the range O(n
k) and even O(2
n).
Table 6 details the best solutions found, comparing the execution times and values obtained from the optimization variables.
Table 6 summarizes the configuration parameters and the results obtained by the PSO and GWO for the best optimization runs for each algorithm. It should be noted that the values of the upper and lower bound limits of the optimization variables were determined in the first instance by a literature review of related works, with the values reported by these authors but were later refined and adjusted through the initial exploration of the behavior of the algorithms for different combinations of configuration parameters and limit values for the optimization variables. Choosing the right values of the configuration parameters of an optimization algorithm for a given problem is important since they directly affect the performance of the algorithm, both in its speed of convergence and in the quality of the solution found, that is, whether it remains trapped in local optimums. Choosing unsuitable values for the configuration parameters of the optimization algorithms, e.g., too wide maximum and minimum limits, too large or too small population size, among others, can cause the algorithm to be slower to find the best solution, or even not to find a satisfactory solution. This would result in an unsuitable battery model, with a significant error between reference models and the proposed battery model.
The analysis of the findings presented in
Table 6 is crucial for understanding the performance and efficiency of both algorithms in optimizing the hybrid-electrical lithium-ion battery model.
Table 6 shows that the GWO algorithm achieved a slightly better best objective function value (131.6906) than the PSO algorithm (131.7112). This suggests that the GWO model might offer marginally improved optimization performance. It should be noted that although the optimization algorithm finds a set of values for the vector of optimization variables (RTS, CTS, RTL, CTL), the objective of the optimization is not the estimation of constructive electrical values of a battery, but rather an equivalent model that explains the dynamics of the battery without being necessary that the values of these virtual electrical variables have a physical interpretation. This optimization aims to minimize the error between the battery current estimated by the model and the experimental dataset. A significant difference is found in the execution times, with the GWO algorithm presenting a considerably faster execution time (75.00 s) than the PSO algorithm (185.00 s). However, it is worth noting that the GWO algorithm also exhibits the slowest execution time (10,654.00 s), slightly higher than the PSO algorithm’s slowest execution time (10,060.00 s). This information indicates that although the GWO algorithm can achieve quicker solutions, its execution time may vary considerably.
3.2. Proposed Optimized Model Evaluation
Validation of the developed lithium-ion battery model is essential to ensure its accuracy and reliability. In this study, experimental data were used to validate the performance of the developed model under different conditions, including charge/discharge cycles. The model’s parameters were determined based on the electrochemical and electrical characteristics of the battery, and the model’s accuracy was evaluated using statistical metrics, such as the root mean square error (RMSE). The validation results show that the developed model accurately predicts the behavior of the lithium-ion battery, and the RMSE between the simulated and experimental current output was minimized. The current parameter was selected as the focus of analysis, as it showed the highest error between the proposed and experimental data. Therefore, the objective function sought to minimize this error using the optimization algorithms presented in this work.
3.2.1. Battery Terminal Voltage
One of the parameters that can be accessed through the technical specifications of batteries is the open circuit voltage, while users can measure the terminal voltage. As a result, experimentation with these parameters was required. The model (and its subsequent optimization) was carried out using the open circuit voltage, whereas the terminal voltage provided data that the user could quantify.
Figure 5 shows the predicted terminal voltage using the model compared to the experimental data obtained. This also demonstrates how the optimization algorithms improved the model. This was conducted under standard temperature conditions (25 °C, with a charge ratio of 3.2 C). The main comparisons are accompanied by the computation time used by the optimization algorithms.
3.2.2. Battery Current
A parameter sensitivity analysis determined that the current delivered by the battery has the most significant influence on the battery model analysis. This is not only from a comparative standpoint but also for the practical application of the battery, as it could be a determining factor for its integration into an energy system.
Figure 6 demonstrates how the optimization algorithms aim to approach the values obtained through experimentation, thereby reducing the error, and assigning optimized values to the established model. Upon closer inspection, the GWO algorithm tends to approach the experimental results more closely. In addition,
Table 6 showcases the performance of the proposed model, the PSO-optimized model, and the GWO-optimized model under two different sets of conditions: 25 °C temperature with 3.6 °C current and varying timing components (454.8947 and 10,654.387312 s). The performance is measured using the RMSE, which calculates the differences between the predicted battery current values and the values obtained from the experimental dataset. Lower RMSE values indicate a more accurate model with predictions that closely resemble the experimental data.
After examining
Table 7, it is evident that the PSO and GWO models outperform the proposed model under both sets of conditions. For the first set of conditions (25 °C; 3.2 C, 455 s), the RMSE values for the proposed non-optimized, PSO, and GWO models are 48.0662, 0.2909, and 0.1700, respectively. Similarly, for the second set of conditions (25 °C; 3.2 C, 10,654 s), the RMSE values are 48.0662, 0.2915, and 0.1705. In both cases, the PSO and GWO models exhibit significantly lower RMSE values than the proposed model, suggesting superior performance and a better fit to the experimental data.
The RMSE values for the PSO and GWO models are similar, indicating comparable accuracy in predicting battery current under the given conditions. However, the GWO model displays slightly lower RMSE values in both cases, suggesting that it may offer a marginally better performance than the PSO model. This analysis demonstrates that the PSO and GWO models predict battery current under the tested conditions more accurately than the non-optimized proposed model. The GWO model exhibits the best performance among the evaluated models.
In recent research, RMSE values have been used as the objective function performance index for different parameters in the optimization of battery modeling.
Table 8 shows some authors, the sought-after parameters, and the values from this work.
The optimization of these parameters using PSO and GWO algorithms has led to significant improvements in the performance of the battery model, as indicated by the reduced RMSE values presented in the previous analysis.
4. Conclusions
This study analyzes lithium-ion battery modeling and optimization using PSO and GWO algorithms. The research emphasized the battery terminal voltage and current in the battery as key parameters in the evaluation of the optimization algorithms’ performance.
The analysis of terminal voltage demonstrated that both the PSO and GWO algorithms improved the model compared to the proposed non-optimized model. The GWO-optimized model exhibited a lower RMSE value of 0.1700 (at 25 °C; 3.6 C, 455 s simulation time) and 0.1705 (at 25 °C; 3.6 C, 10,654 s simulation time) compared to the PSO-optimized model with RMSE values of 0.2901 and 0.2915, respectively, meaning an average RMSE reduction of 42% achieved by the GWO in comparison to the PSO algorithm. These results indicate that optimized models could provide more accurate predictions, allowing users to make informed decisions in battery applications.
Regarding the battery’s current, the study established that it has the most significant influence on battery model analysis. The optimized models, especially the GWO model, exhibited enhanced performance in predicting battery current under various conditions, with a marginally lower RMSE value than the PSO model, offering practical implications for integrating batteries into energy systems.
The performance comparison of the PSO and GWO algorithms revealed that the GWO algorithm had a faster convergence rate than the PSO algorithm. The GWO algorithm was also found to be less sensitive to initial conditions, suggesting that it may be more robust and reliable for optimizing the parameters of the battery model.
The research concludes that securing convergence for optimization algorithms in problems with unknown search space topology involves preliminary exploration of potential solutions by testing extreme configuration parameter values. Once these parameters are identified, convergence is considered assured. The evaluated objective function in this study converged between values 131 and 132, with a varying number of function evaluations. The analysis of algorithm execution time reveals insights into computational complexity, with both PSO and GWO showing potential polynomial complexities. This study emphasizes the importance of comparing execution times and values obtained from optimization variables, demonstrating how the algorithms aim to approach values obtained through experimentation. Additionally, the use of current as the analyzed parameter distinguishes this work from others, which typically focus on parameters like SOH, voltage, or current in battery modeling optimization. The research ultimately contributes to reducing errors and assigning optimized values to the established model.
An analysis of the execution time for different population values for both PSO and GWO can provide insights into the computational complexity of these algorithms. In the case of the PSO algorithm, the rate change of execution time from a population size of 10 to a maximum of 1000 suggested a greater than linear dynamic, showing a polynomial complexity in the order of O(nk). For the GWO, the execution time from populations of 10 to 1000 implies a polynomial complexity potentially in the range of O(nk) or O(2n).
The implications of this study’s findings are significant for designing and operating lithium-ion batteries in various applications, including electric vehicles, portable electronics, and renewable energy systems. The optimized battery models can help improve efficiency and performance in these applications, with the GWO-optimized model outperforming the proposed model by more than 282 times in terms of RMSE values. Furthermore, the study can inform the development of future optimization algorithms and battery models, enhancing their accuracy and reliability. This research has demonstrated the effectiveness of using optimization algorithms, particularly the Grey Wolf Optimizer, in improving lithium-ion battery models. The insights gained from this study can contribute to advancing battery technology and its applications across various industries. Nevertheless, to improve the model, it must be tested using other batteries.