*3.1. Training*

In total, eight experimental time series of the LFP cell were available and used for training the GB model. In particular, six time series represent charge and discharge with a CCCV protocol at different C-rates, and two time series represent charge and discharge with pulsed current.

The neural networks representing the functions *f* ∗ and *g*∗ were used to approximate the dependency of the charge-transfer resistance *R*<sup>1</sup> on current and SOC. We performed the training with different network sizes for *f* ∗ and *g*∗. Additionally, we varied the number of training epochs in the first training step. Training step two was not changed. Figure 4 shows the results after completing the whole training process. Here the obtained value for *R*<sup>1</sup> is plotted as a function of SOC for charging with *i*bat = −50 A. The results shown in the left panel of Figure 4 were obtained from the evaluation of function *f* ∗ with different numbers of neurons in the hidden layer and 100 epochs during the first training part.

With only 10 hidden neurons, the result takes the form of a combination of two linear branches representing the charge-transfer resistance over the whole range of SOC. With an increasing number of neurons, the dependency of *R*<sup>1</sup> on SOC gets more complicated. The results vary only slightly when increasing the number of hidden neurons from 100 to up to 300, however at the cost of longer training times. Using a standard notebook and training on the CPU the training time for the first training part with 100 epochs increased from about 15.5 min to about 16.8 min when changing the number of hidden neurons from 100 to 300. Therefore, we decided to choose 100 hidden neurons for *f* ∗ and *g*∗.

**Figure 4.** Simulation results: approximation results for *R*<sup>1</sup> for *i*bat = −50 A derived from evaluation of function *f* ∗; (**left**): results for a varying number of hidden neurons in *f* ∗ and 100 training epochs in the first training part; (**right**): results for 100 hidden neurons in *f* ∗ and a varying number of training epochs in the first training part.

We additionally varied the number of training epochs in the first training step. The right panel of Figure 4 illustrates the final results for *R*<sup>1</sup> at a battery current *i*bat = −50 A obtained with the neural network *f* ∗ with 100 hidden neurons and a varying number of training epochs. With an increasing number of training epochs, the neural network produces more complex behaviour of *R*<sup>1</sup> as function of SOC.

After training with more than 300 training epochs, the right panel of Figure 4 shows changes in *R*<sup>1</sup> for low SOC values. We believe that this is due to overfitting. As there were few data available, we did not split off a validation data set. However, we took a closer look at the training and test losses (note that the test results will be discussed in more detail in Section 3.3). We calculated the RMSE between the measured and the approximated battery voltage for all training and test data sets. The overall training and test losses were defined as the average of the RMSE losses of the individual data sets. Figure 5 shows the results as a function of the number of training epochs. The training loss decreases with an increasing number of training epochs in the first training step. However, the test loss reaches a minimum at around 300 training epochs. These results made us choose 300 training epochs in the first training step.

As a final result from this analysis, we represented *f* ∗ and *g*∗ with neural networks with one hidden layer with 100 hidden neurons each. We carried out 300 training epochs in the first and another 30 epochs in the second training step.

**Figure 5.** Average training and test losses as a function of the number of training epochs in the first training part.

Figure 6 illustrates the final training results for R1. The left panel shows the results for charging (*i*bat < 0 A) as evaluated with *f* <sup>∗</sup>. The right panel shows the results for discharging (*i*bat > 0 A) as evaluated with *g*∗. The charge-transfer resistance is in the range of up to several milliohms. It decreases with an increasing absolute battery current for both charging and discharging, and reaches higher values for low and high SOC values compared to a medium SOC. The resistance shows a pronounced asymmetry between charge and discharge: During charge the highest values occur when the cell is (nearly) full. During discharge the highest values occur when the battery is (nearly) empty. This is a typical behaviour observed from lithium-ion batteries with LFP cathode [18]. However, it is difficult to interpret electrochemical details into a simple equivalent circuit. In Ref. [46] the overpotentials of a lithium-ion cell were deconvoluted. The results show that lithium-ion batteries are co-limited by reaction, diffusion, and ohmic losses. In the present paper, the battery is operated at rather low currents (up to 1 C), where diffusion limitations are expected to be not dominant. For a single charge-transfer reaction, the charge-transfer resistance decreases exponentially with increasing direct current in the Tafel region [47]. Therefore, the observed decrease in resistance with increasing current is physically realistic.

After completing the training procedure, the learnable parameters had the following values:

$$\begin{aligned} \omega\_0 &= 191.5 \,\text{Ah} \\ \omega\_1^\* &= 0.5069 \,\text{F} \\ \omega\_2^\* &= 0.1125 \,\text{V} \\ \omega\_3^\* &= 0.2814 \,\Omega. \end{aligned}$$

This results in the following ECM parameters:

$$\begin{aligned} \text{C\_{bat}} &= 191.5 \,\text{Ah} \\ \text{C}\_{1} &= 50.69 \,\text{kF} \\ \upsilon\_{\text{hys}} &= 11.25 \,\text{mV} \\ R\_{\text{S}} &= 281.4 \,\text{μ} \Omega. \end{aligned}$$

**Figure 6.** Simulation results: approximation results for *R*<sup>1</sup> as a function of SOC for different battery currents; (**left**): charging, (**right**): discharging.
