1. Introduction
Vanadium redox flow batteries (VRFBs) [
1] are advanced energy storage systems designed for large-scale applications due to their flexibility, safety, and long life cycle [
2,
3,
4]. These benefits have resulted in a 21% yearly increase in VRFBs in China [
5]. The principle of operation is based on storing energy in vanadium ions dissolved in electrolyte solutions, which are circulated through electrochemical cells during charging and discharging, as shown in
Figure 1 [
1]. There are several modeling approaches for VRFBs, including equivalent circuit models. These models provide a discrete set of equations selected to express the operating condition of the battery. The coefficients must also change based on various sizes and operating conditions. Puleston et al. [
6] provided a comprehensive review of modeling and estimation methods for vanadium redox flow batteries (VRFBs). The review highlights state observers, parameter estimation techniques, and dynamic models for estimating internal states like state of charge (SOC) and State of Health (SOH), emphasizing the challenges of managing VRFBs’ nonlinear behavior.
Machine learning (ML) is a transformative tool that enables systems to analyze large datasets, uncover patterns, and model complex, nonlinear relationships with minimal programming [
7]. Introduced by Sir Francis Galton in the late 19th century [
8], linear regression is a statistical method that, in its modern form, can optimize operating parameters and predict performance metrics. Ridge [
9,
10,
11,
12] and Lasso [
13] recession methods were introduced to shrink or eliminate the coefficients, effectively performing feature selection while maintaining predictive accuracy. Random Forest (RF) algorithms have gained attention for their robustness, ability to model nonlinear relationships, and resistance to overfitting. For instance, in a study focused on electrode optimization, Random Forest and Gradient Boosting methods were applied to predict and enhance the microstructural characteristics of carbon cloth electrodes in VRFBs, ultimately aiming to improve energy efficiency [
14]. Another study employed ensemble ML techniques, including Random Forest, to predict power loss in VRFB systems under varying operating conditions, demonstrating the effectiveness of data-driven approaches in capturing complex system behaviors [
15].
The modeling of batteries has been advanced by machine learning tools. Operating parameters and performance metrics, like state of charge (SOC) and voltage, have been accurately replicated [
16]. Li et al. [
17] integrated ML with Absolute Nodal Coordinate Formulation (ANCF-e.), which used machine learning (ML) techniques to estimate nonlinear potentials, such as open-circuit potential, electrolyte potential, and lithium-intercalation overpotential, in lithium-ion batteries (LIBs) with reduced computational complexity for real-time state and parameter estimation. Two hybrid models, “HYBRID-I and HYBRID-II,” were introduced to integrate the Single-Particle Model with Thermal dynamics (SPMT) and feedforward neural networks (FNNs) to improve the prediction of lithium-ion battery behavior [
18]. Using linear regression, Support Vector Regression, and XGBoost on data in a 1 kW, 6 kWh VRFB, XGBoost achieved the best performance (R
2:0.99, MAE:0.24, RMSE:0.32), demonstrating its effectiveness in optimizing VRFB thermal management. The SOC improvement, voltage, and current predictions were developed through a deep reinforcement of the learning framework [
19]. Compared to traditional methods like Kalman filters and regression, deep Q-learning and dueling DQN improved accuracy by 10%, particularly in voltage prediction, demonstrating more accurate model generalization. An optimization framework was developed for VRFBs using ANN and GA to maximize net discharge power [
20]. By optimizing the electrode compression ratio, applied current density, and electrolyte inflow rate, the hybrid ANN-GA approach reduced resistances by 66% and improved efficiency, outperforming traditional methods across different SOC levels.
Zheng et al. [
21] used a Recurrent Equilibrium Network (REN), a neural network-based approach, to estimate the state of charge (SOC) in vanadium redox flow batteries. The model was trained on real-world data using voltage, current, and temperature inputs. It outperformed BPNN (Backpropagation Neural Network) and LSTM (Long Short-Term Memory), showing high accuracy and robustness. Narayan et al. [
22] applied machine learning models (LR, SVR, XGBoost) to predict the temperature rise in vanadium redox flow batteries under varying current conditions. Using experimental data, XGBoost achieved the highest accuracy (R
2 = 0.99), showing strong potential for thermal management. Xiong et al. [
23] used a GRU-based neural network model to predict the terminal voltage in VRFBs, incorporating the flow rate, current, SOC, and voltage. Trained on experimental data, the model outperformed ECMs, SVM, and BPNN with an MAE < 0.006 V and R
2 > 0.99, proving effective for real-time control. Martínez-López et al. [
24] used two ANN models trained on CFD-generated data to predict cell voltage and overpotential in VRFBs. Their models achieved high accuracy (R ≈ 0.999) and drastically reduced the computation time, enabling fast, real-time battery analysis.
Despite these advancements, most studies have focused on optimizing specific subsystems (e.g., electrodes) or predicting individual performance metrics (e.g., power loss, temperature rise). They often focus on optimizing isolated components or evaluating a single algorithm. Few works have conducted a direct, systematic comparison between interpretable models like Multiple Linear Regression (MLR) and more complex ensemble methods such as Random Forest (RF) in the context of full VRFB system modeling. Addressing this gap, the present work evaluates both MLR and RF models using the same experimental dataset to benchmark their predictive accuracy, interpretability, and applicability to dynamic and steady-state battery behavior.
The selection of MLR and Random Forest for this study is motivated by their complementary strengths. MLR is a foundational, interpretable algorithm that provides explicit weight-based relationships between input features and predicted output, making it ideal for deriving analytical insights into battery behavior. In contrast, Random Forest is a powerful ensemble method that captures complex nonlinear dependencies and interactions without requiring detailed domain-specific feature transformations. Compared to more computationally intensive models such as deep neural networks or support vector machines, RF offers strong predictive performance while maintaining relatively low training costs and good generalizability. This combination allows for both model transparency and accuracy in VRFB performance prediction.
This paper develops MLR and Random Forest models to predict VRFB performance based on experimental datasets. Furthermore, it evaluates both approaches based on their prediction accuracy and computational running times, providing practical insights into their suitability for real-time applications. It presents a novel model of VRFB through a single governing equation utilizing ML techniques, which includes a large set of operating points and size variations. Experimental data is used to train the ML model. Several operating conditions are examined and compared with the existing literature. The
Table 1 shows the Nomenclature.
2. Operating Principle of VRFB
The VRFB consists of two tanks (
Figure 1). The tanks store the electrolytes with four different oxidization states. These electrolytes circulate by pumps through a cell stack where redox reactions occur, facilitating charge and discharge. The cell stack of a VRFB consists of bipolar plates (graphite or composite), graphite felt electrodes, and an ion-exchange membrane (typically Nafion) that enables proton transfer while preventing electrolyte mixing. Flow frames and gaskets from corrosion-resistant materials like PVC or PTFE ensure proper electrolyte distribution and sealing. These are
(same as
), and
(which is the same as
). The chemical cell reactions are as follows:
In this research, the VRFB specifications used were similar to those by Kim et al. [
25]. Specifications are shown in
Table 2.
3. Dynamics of VRFB
The operation of vanadium redox flow batteries (VRFBs) involves complex dynamic processes governed by electrochemical, electrical, and transport phenomena. Understanding these dynamics is critical for the accurate modeling, efficient control, and real-time state estimation of VRFB systems.
Three key physical phenomena dominate the dynamic behavior of VRFBs:
The Nernst equation governs the open-circuit voltage (OCV) as a function of the state of charge (SOC) and reaction kinetics.
Shunt currents arise due to parasitic pathways between cells in series, resulting in efficiency loss and imbalances.
Diffusion currents reflect concentration gradients within the electrolyte, influencing both voltage response and charge transport.
3.1. Nernst Equation and State of Charge
The open-circuit voltage (OCV) of the vanadium redox flow battery (VRFB) depends on the concentrations of the active species and the operating temperature. The OCV can be expressed using the Nernst equation:
The electrolyte’s state of charge (SOC) represents the overall concentration level of vanadium ions within the battery.
3.2. Shunt Current and Diffusion Current
Shunt currents result from potential gradients across the cell stack, driving ion movement through manifolds and guide channels, reducing coulombic efficiency. Minimizing them requires increasing electrolyte path resistance using narrow channels and common manifolds. During charging, shunt currents lower the available cell current, while during discharge, they increase it, leading to efficiency losses. Though minimal in this study [
26] (<0.15 A), their impact grows with more series-connected cells, making them critical in large-scale VRFBs. Additionally, vanadium ion diffusion causes self-discharge and side reactions, leading to capacity loss over extended cycling.
To simplify the analysis, Zhang [
26] proposed an equation to estimate the diffusion effect. The complementary part of the coulombic efficiency
is denoted as the diffusion ratio
, which represents the self-discharge loss due to ion diffusion in each charge/discharge cycle. The diffusion ratio is defined as follows:
Based on Kim’s report [
25], the coulombic efficiency is approximately 95%, resulting in a diffusion ratio
of 5%. The term
is introduced to estimate the self-discharge current caused by ion diffusion.
4. Machine Learning: Multiple Linear Regression
Machine learning regression (MLR) enhances traditional regression by efficiently capturing nonlinear relationships in high-dimensional data. In battery electrochemical modeling, MLR predicts key parameters like terminal voltage and internal resistance based on factors such as the SOC, current density, and temperature. Unlike computationally intensive models, Multiple Linear Regression (MLR) is a statistical method used to model the relationship between a dependent variable and multiple independent variables by fitting a linear equation to observed data. The general form of MLR is , where y is the dependent variable, are the independent variables, is the intercept, are the coefficients (weights), and represents the error term. The weights are calculated by minimizing the sum of squared residuals, which is the difference between the observed and predicted values of y. This is typically performed using methods like Ordinary Least Squares (OLS), where the weights are computed as with “ representing the matrix of independent variables and y is the vector of observed dependent variable values. This approach ensures that the best-fit line minimizes prediction errors while balancing all contributing factors.
Another technique used with MLR is L2 regression, also known as Ridge regression, which adds an -norm penalty to the cost function, which discourages large coefficient values by minimizing their squared magnitudes, reducing model complexity, and preventing overfitting without eliminating any variables.
In
Figure 2 the first step is Input Data. This data was collected from [
25]. Twelve curves of the voltage–capacity experiment results were digitized to obtain the numerical value of the results.
Step 2: Data Cleaning. This step involves removing or handling missing values, outliers, and inconsistencies in the dataset. It ensures the quality of the data for analysis.
Step 3: Normalization, where we scale the features to a standard range, often between 0 and 1. This step ensures that features with more extensive ranges do not dominate those with smaller ranges.
Step 4: Feature engineering and the creation of additional features. In this step, we used Kirchhoff’s law and calculated the following features: terminal current, time,
,
,
,
,
,
,
,
, flow rate, and
. These features were calculated using the experiment specifications as in
Table 2.
Step 5: Data Splitting. Data was split into training and validation data: 80% of the data for training, and 20% for data testing.
Step 6: Feature Selection on the training data. Here, we used the features as in Equations (9) and (10). This will make the calculated weights lead to the ECM parameters. We also removed the intercept term to model the exact equations.
Step 7: Model Building. Using the training data, the MLR model is built by finding the optimal coefficients for the linear relationship between predictors and the target variable.
Step 8: Ridge Regularization set. A technique to prevent overfitting by penalizing large coefficients in the model. L2 regularization (Ridge regression) introduces a hyperparameter to balance the trade-off between minimizing the error and maintaining smaller coefficients. The search of was from to 100. The best value is found and validated from the validation data.
Step 9: Evaluation of Results. The testing data is used here to evaluate and test the model’s performance using metrics such as Mean Absolute Error (MAE) and RSS.
The final step is Metric Calculation, where the final performance metrics are calculated to quantify the model’s accuracy and reliability, ensuring it meets the desired performance criteria.
Additional steps are used when needed, e.g., Lasso regression, where a linear regression technique is utilized that adds an -norm penalty to the cost function, shrinking less significant coefficients to zero, effectively performing variable selection and regularization to enhance model simplicity and prevent overfitting.
5. Random Forest Modeling
Random Forest is an ensemble-based machine learning algorithm that builds multiple decision trees and aggregates their outputs to achieve better generalization performance, as shown in
Figure 3 and
Figure 4. For regression tasks, such as predicting the terminal voltage of vanadium redox flow batteries (VRFBs), the model averages the output of all trees:
where
is the predicted voltage, T is the total number of trees, and
is the prediction from the t-th decision tree given input vector x.
Each tree is trained using a different bootstrap sample of the data. To further de-correlate the trees, only a random subset of the input features is considered at each split within each tree. This process reduces overfitting and improves robustness.
5.1. Modeling Workflow
The complete pipeline as shown in
Figure 4 used in this study is outlined below as follows:
We extracted experimental data for 12 VRFB charge/discharge cycles from Zhang et al. using digitization techniques. Each dataset includes voltage, capacity, current, SOC, flow rate, and other derived features. We added a transformed feature: . Redundant variables and noise-sensitive columns were removed during preprocessing.
- 2.
Feature Engineering
Among the engineered features, the natural logarithmic transformation ln(SOC/(1?SOC)) was included due to its strong basis in electrochemical theory. This transformation reflects the theoretical structure of the Nernst equation, which governs the open-circuit voltage of redox systems as a logarithmic function of reactant concentrations. In the context of VRFBs, the SOC influences terminal voltage nonlinearly, especially near the limits of charge and discharge. The ln(SOC/(1?SOC)) term helps the model better capture these nonlinear dynamics, improving accuracy in regions where voltage changes rapidly.
Features were divided into dynamic and stationary zones based on observed voltage behavior. We created a feature matrix and target vector. Seventeen features were chosen including current, flow rate, SOC, time, capacity, etc. The target is measured terminal voltage.
- 3.
Data Splitting
The dataset was split into 80% training/validation and 20% test sets using MATLAB R2024a cvpartition. The data size was 1103 for training and 275 for testing.
- 4.
Model Training
A Random Forest regressor was trained using fitrensemble with the bagging method.
- 5.
Evaluation
We calculated the ME, MSE, RSS, and RMSE on both the training and test sets. Partial dependence plots (PDPs) and 2D heatmaps were generated to interpret the influence of top predictors.
- 6.
Feature Importance
Feature importance was assessed via the predictorImportance() function. SOC and current were identified as the most influential features in predicting voltage behavior, aligning with physical intuition.
5.2. Out-of-Bag (OOB) Error for Tree Selection
Out-of-bag error was monitored to determine the optimal number of trees:
where O is the set of OOB samples and
is the OOB prediction for the i-th sample. In our model, the OOB error stabilized at 70 trees, which was selected to balance accuracy and computational efficiency.
6. Simulation Results
6.1. MLR-Based VFRB Model
In this model, we initially used most of the data features. The initial candidate features were extracted from the experimental data, including voltage, current, flow rate, SOC values, and time-integrated signals. To reduce redundancy and improve model performance, a two-step feature selection process was applied. Firstly, Lasso regression and Ridge regularization were used to penalize less influential coefficients based on their contribution to model accuracy. Then, secondly, features that were functionally dependent or strongly correlated with others were removed based on domain knowledge. For example, SOC_cell was excluded because its information is captured in the logarithmic term
, and
SOC_tank was dropped due to its strong correlation with SOC_cell. Similarly, current-related variables such as I_{diff}, I_{cell}, and I_{cell-integral} were excluded since they are derivable from I_{load} and its time integral. After these filtering steps, the final MLR model was constructed using eight features that showed both strong physical relevance and statistical significance in predicting terminal voltage, resulting in the following single governing equation for the proposed VRFB model:
In Equation (10), the predicted terminal voltage V is modeled as a weighted sum of engineered features, with coefficients learned from the training data. The variables are defined as follows:
CD: current density (mA/cm2);
Q: electrolyte flow rate (L/min);
: terminal load current (A);
: shunt current due to side paths (A);
: open-circuit potential (V);
Charging state: binary indicator (1 for charging, 0 for discharging);
: time-integrated load current (cumulative charge delivered, A·s);
: log-transformed state of charge (dimensionless), derived from the Nernst equation formulation.
Each term captures a key operational parameter affecting VRFB voltage behavior, with both electrochemical and time-dependent contributions included. The resulting model coefficients are shown in
Table 3.
To evaluate the sensitivity of model performance to different data split ratios, we tested the MLR and RF models using 70/30, 80/20, and 90/10 train–test partitions. As shown in
Table 4, both models maintained consistent accuracy across splits, though RF consistently outperformed MLR in all metrics. The RF model achieved the lowest RMSE of 0.1157 V with a 90/10 split, compared to 0.1833 V for MLR. Even at the lower training ratio (70/30), RF achieved better error values (RMSE = 0.1561 V) than MLR at any ratio. These results indicate that the RF model is robust to variations in training size and generalizes well, while MLR shows slightly more sensitivity to data partitioning, as shown in
Table 4 and
Figure 5. In the machine learning literature, an 80/20 train–test split is widely accepted as a standard baseline due to its balance between sufficient training data and statistically meaningful evaluation [
27]. The findings in this study confirm the appropriateness of that choice while also demonstrating that RF maintains high accuracy even with limited training data, making it a strong candidate for real-time VRFB system modeling. The 80:20 split evaluation metrics for the training data and the test data are in
Table 5.
Table 5 presents a side-by-side comparison of evaluation metrics for the Multiple Linear Regression (MLR) and Random Forest (RF) models based on the test dataset. The RF model consistently achieved lower error values across all metrics: mean error (ME), mean squared error (MSE), residual sum of squares (RSS), and root mean squared error (RMSE). Specifically, RF produced a total RMSE of 0.1689 V compared to 0.1796 V for MLR, and a lower total RSS of 7.85 versus 8.87. These results confirm that the RF model provides more accurate and less biased voltage predictions for VRFB systems than the linear MLR model.
Figure 6 compares the prediction errors of the Random Forest (RF) and Multiple Linear Regression (MLR) models using four metrics—ME, MSE, RSS, and RMSE—across dynamic, stationary, and overall regions. The RF model consistently outperformed MLR, particularly in dynamic conditions, with lower RMSE (0.2047 V vs. 0.2251 V) and RSS (2.43 vs. 2.94). In stationary regions, RF also showed slightly better accuracy, and overall, it achieved the lowest total RMSE (0.1689 V) and near-zero mean error, highlighting its superior robustness and accuracy in modeling VRFB terminal voltage.
Figure 7 shows the predicted values of the trained model compared to the actual experimental training data. The best model will have all points conversed onto the 45-degree line.
Figure 8 shows the terminal voltage of the data recorded from experiments and error residuals for each voltage. This graph demonstrates the error variations with respect to the voltage. The predicted voltage and measured voltages that are not used in the training of ML are shown in
Figure 9.
Figure 10 shows the performance of the Random Forest model training data.
Figure 11 is the model voltage prediction compared to the experimental voltage at various charging capacities. As the figure shows, the prediction and the measurements are in good agreement, as evidenced by the errors shown in
Figure 12.
To ensure a fair comparison between the MLR and RF models, we computed the mean error (ME) and residual sum of squares (RSS) for both methods. As shown in
Table 5, the RF model test data achieved a lower RMSE (0.1699 V vs. 0.1796 V for MLR) and a smaller RSS (7.94 vs. 8.87), indicating a better overall fit to the test data. The ME for RF was also closer to zero (?0.0019 V) compared to MLR (0.0204 V), demonstrating reduced systematic bias. These metrics highlight the RF model’s improved predictive accuracy and robustness, particularly under complex operating conditions.
Figure 13 shows the out-of-bag error compared to the number of trees. As the figure shows, the curves stabilize after 20 trees. We have selected 50 trees to achieve better evaluation metrics. The out-of-bag (OOB) error plot provides an internal validation method for Random Forest models without requiring a separate validation dataset. In Random Forest, each decision tree is trained on a bootstrap sample, leaving approximately one-third of the data unused (the OOB samples) for that tree. The OOB error at each stage is computed as the mean squared prediction error for these unseen samples, averaged across all trees grown so far. In the OOB error curve (
Figure 13), the horizontal axis represents the number of trees included in the ensemble, while the vertical axis shows the corresponding OOB mean squared error. The curve typically decreases sharply at first as more trees are added, then gradually levels off once additional trees provide diminishing improvements in prediction accuracy. Compared to traditional k-fold cross-validation, OOB evaluation is faster and more efficient, as it leverages the bootstrap sampling inherent to the Random Forest algorithm. It also provides an unbiased performance estimate without additional data splitting. This makes OOB optimization particularly useful for iterative model tuning, such as selecting the ideal number of trees while avoiding overfitting.
Figure 14 shows the RF model’s error residual compared to the actual data training set.
Figure 15 shows the same residual error for the test dataset.
Figure 16 shows the RF modeled voltage compared to the measured voltages.
Figure 17 shows the feature importance plot and summarizes the contribution of each input variable to the Random Forest model’s predictive accuracy. In this figure, the horizontal axis represents the normalized importance scores, while each bar corresponds to a specific feature used in the model. Features with longer bars indicate a greater overall reduction in prediction error across the forest when that feature was used for node splits. In contrast, features with smaller bars had minimal impact on the model’s decision-making process. This visualization provides a clear hierarchy of which variables were most influential in driving the model’s predictions, offering a powerful interpretability tool for analyzing complex machine learning models like Random Forest.
Partial dependence plots (PDPs) in
Figure 18 visualize the marginal effect of individual input features on the predicted output of a machine learning model, in this case, the Random Forest regressor. In each PDP, the horizontal axis represents the range of values for a specific input feature, while the vertical axis shows the average predicted terminal voltage as that feature varies, holding all other features constant. The curve illustrates how changes in a single feature influence the model’s output independently of other variables. PDPs provide a valuable tool for interpreting complex, nonlinear models, helping to reveal whether the relationship between a feature and the target is linear, monotonic, or more complex. The model assigned the highest importance to current-related features, particularly time-integrated load current, cell current, and instantaneous load current. These variables directly impact voltage through resistive and electrochemical effects. This highlights the critical role of current dynamics in VRFB voltage prediction and control.
6.2. Model Validation
Following the model construction in the previous section, several loading conditions were executed to validate the model’s response. The model was set to charge with constant current to reach 85% of the tank SOC and then to discharge at constant current discharge (CCCD) to 15% of the tank SOC. The following current densities (60, 100, 200 mA/cm
2) and flow rates (3, 5, 8 L/min) were used.
Figure 19 and
Figure 20 show the results of the nine curves. Since the tank SOC does not depend on the flow rate, the SOC shows only the effect of the current density. It was observed that at a fixed current density under various flow rates, the reach of the maximum SOC was not a function of the flow rate.
Figure 21 and
Figure 22 show this effect regardless of the NL technique used. The governing equations used to build models also confirm that the flow rates affect the charging and discharging potential voltage, but do not influence the tank SOC.
7. Analysis and Discussion
This section presents a comparative analysis of the Multiple Linear Regression (MLR) model and the Random Forest (RF) model, focusing on their performance in the VRFB system’s dynamic and stationary operating regions.
ML predicted a simple equation of features and weights like Equation (10) and
Table 3 with a small mean error. It requires evaluation of all features, which might become a lengthy process. The model started with 23 features, and through the process, only 8 features were not eliminated. Penalty factors L2 and L1 were used to determine and eliminate less important features.
As seen in
Figure 11 in this study, the OOB error curve for the Random Forest model exhibited a rapid decline initially, stabilizing after approximately 50 trees. Beyond this point, adding more trees yielded negligible improvement in prediction performance. Based on this behavior, the number of trees was set to 50 for the final model to achieve an optimal balance between predictive accuracy.
The stabilization of the OOB error indicates that the model has effectively captured the underlying patterns in the VRFB data without overfitting. This result confirms that the Random Forest was appropriately tuned and supports the reliability of the subsequent performance evaluations and feature interpretation analyses.
In the present study, the feature importance analysis in
Figure 17 identified the integrated load current (
) as the most influential predictor, followed closely by the instantaneous cell current (
) and terminal load current (
). These results are physically intuitive, as both instantaneous and cumulative current directly impact voltage through resistive losses and charge depletion effects. The binary discharging state also showed high importance, indicating that charging and discharging phases significantly modulate the terminal voltage behavior. Current density (CurrentDensity mA/cm
2) contributed moderately, while open-circuit voltage (
E_opvt) and state of charge in the cell (
SOC_cellt) captured the electrochemical aspects of the system. The natural logarithm of SOC (
lnSOC) further reflected the theoretical relationship between SOC and potential, consistent with the Nernst equation. These findings confirm that the Random Forest model captured both the electrical and electrochemical dynamics that govern VRFB voltage behavior.
The PDPs generated in
Figure 18 for the top eight features revealed important patterns consistent with VRFB behavior. As the integrated load current (
) and instantaneous load current (
) increased, the predicted voltage exhibited a noticeable decline, reflecting internal resistive losses. The PDPs for cell current (
) and current density (CurrentDensity mA cm
2) showed similar step-like reductions in voltage with increasing current, indicating discrete operating regimes possibly corresponding to different flow rates or SOC levels. The discharging state induced a sharp voltage transition between charging and discharging phases, highlighting its critical control role. Meanwhile,
SOC_cellt,
lnSOC, and
E_opvt all showed positive monotonic relationships with terminal voltage, consistent with the expected Nernstian behavior where voltage increases with SOC. These observations demonstrate that the Random Forest model effectively captured both the electrochemical and operational dependencies governing VRFB voltage dynamics.
A comprehensive comparison was conducted between the Multiple Linear Regression (MLR) and Random Forest (RF) models to evaluate their accuracy across different operating conditions of the VRFB system. The test dataset was segmented based on capacity, with the dynamic zone defined as capacity less than 8 A·h, and the stationary zone defined as capacity greater than or equal to 8 A·h. Error metrics including mean error (ME), mean squared error (MSE), residual sum of squares (RSS), and root mean squared error (RMSE) were computed for each region, as summarized in
Table 4.
In the dynamic region, where system behavior changes rapidly, the RF model achieved better performance with an RMSE of 0.2047 V, compared to 0.2251 V for MLR, and a lower RSS (2.43 vs. 2.94). This indicates that RF more effectively captures nonlinear voltage transitions under fluctuating loads.
In the stationary region (capacity ≥ 8 A·h), both models performed similarly, but RF maintained a slight edge with an RMSE of 0.1580 V versus 0.1653 V for MLR, along with lower MSE and RSS values.
Overall, across all capacity values, the RF model demonstrated consistently better accuracy, with a total RMSE of 0.1689 V compared to 0.1796 V for MLR, and a total RSS of 7.85 versus 8.87. The ME for RF was also closer to zero, indicating minimal prediction bias.
While MLR offers the benefits of interpretability and simplicity, its linear formulation limits its ability to model nonlinearities inherent in VRFB voltage dynamics. In contrast, the Random Forest model provides superior robustness and adaptability, making it a strong candidate for real-time predictive control in flow battery systems.
These results demonstrate that the Random Forest model is well-suited for predicting VRFB terminal voltage across both dynamic and stationary operating regions. Its consistent accuracy and low error metrics highlight its value as a standalone tool for real-time system modeling. However, future work should explore the potential of deep learning models, such as recurrent neural networks (RNNs) or physics-informed neural networks (PINNs), which may offer enhanced performance in capturing long-range dependencies and complex nonlinear behavior. A comparative analysis between Random Forest and deep learning approaches would help determine the most effective modeling framework for deployment in real-time VRFB control and digital twin systems.
While temperature significantly affects VRFB behavior, this study was conducted at a constant temperature, and thermal effects were not modeled. Future work will incorporate temperature as an input feature to assess model robustness under varying thermal conditions.
8. Conclusions
This study presented a comprehensive investigation into the modeling of vanadium redox flow batteries (VRFBs) using two machine learning techniques: Multiple Linear Regression (MLR) and Random Forest (RF). Experimental data from various operating conditions was used to train, validate, and evaluate both models. While the MLR model demonstrated reasonable predictive performance in stationary regions, it consistently underperformed in dynamic zones and showed higher overall error metrics. In contrast, the Random Forest model achieved superior accuracy across all operational regimes, including dynamic and steady-state regions, with lower mean error, residual sum of squares, and RMSE values.
These findings confirm the robustness and versatility of the Random Forest model for real-time voltage prediction in VRFB systems. Its ability to capture nonlinear system dynamics makes it a strong candidate for deployment in control systems and digital twin applications. Future research should focus on benchmarking Random Forest against advanced deep learning models, such as recurrent neural networks (RNNs) and physics-informed neural networks (PINNs), to determine the most effective framework for high-fidelity, real-time modeling of flow batteries.