*2.3. Grey-Box Model*

We took the ECM given by Equations (4) to (6) as a basis for GB modelling. The nominal capacity of a battery is usually given by the manufacturer. It indicates the capacity of a fresh cell. However, the real (experimentally observed) battery capacity *C*bat can deviate from the manufacturer's claims. For this reason, we considered the capacity *C*bat in Equation (4) as a learnable parameter. In Equation (5) the double-layer capacitance *C*<sup>1</sup> and the charge-transfer resistance *R*1, as well as its dependency on SOC and battery current, are unknown. Therefore, we introduced a second learnable parameter to represent the capacitance *C*1. As we wanted to take into account that the charge-transfer resistance may have different values and characteristics during charging and discharging (as observed experimentally [18]), *R*<sup>1</sup> is described by two learnable functions. Depending on the sign of the battery current, one of these functions is chosen; at zero current (*i*bat = 0 A) the mean is taken. In the output Equation (6) we had to establish a link between OCV and SOC. The manufacturer usually only provides finite-rate charge/discharge curves. Therefore, we derived *v*OC(SOC) from dedicated measurements (so-called quasi-OCV measurements). The hysteresis voltage drop *v*hys and the serial resistance *R*<sup>S</sup> are assumed constant in Equation (6). We introduced two more learnable parameters to approximate these two

values. Overall, using these assumptions, the ECM according to Equations (4) to (6) leads to the following GB model:

$$\frac{\text{dSOC}}{\text{d}t} = -\frac{1}{\omega\_0} i\_{\text{bat}}\tag{7}$$

$$\frac{\mathrm{d}\upsilon\_{\mathrm{RC1}}}{\mathrm{d}t} = \frac{1}{\omega\_1} \cdot \left(\mathrm{i} - \frac{1}{R\_1(\mathrm{SOC}, i\_{\mathrm{bat}})} \cdot \upsilon\_{\mathrm{RC1}}\right) \tag{8}$$

$$\{\mathcal{A}(\mathsf{SOC}) : \quad \vec{a} \,\,\,\,\} \tag{9}$$

$$R\_1(\text{SOC}, i\_{\text{bat}}) = \begin{cases} f\left(\text{SOC}, i\_{\text{bat}}, \vec{\theta}\_f\right) & \forall \, i\_{\text{bat}} < 0 \\ g\left(\text{SOC}, i\_{\text{bat}}, \vec{\theta}\_{\mathcal{S}}\right) & \forall \, i\_{\text{bat}} > 0 \\ \frac{1}{2}\left(f\left(\text{SOC}, i\_{\text{bat}}, \vec{\theta}\_f\right) + g\left(\text{SOC}, i\_{\text{bat}}, \vec{\theta}\_{\mathcal{S}}\right)\right) & \text{else} \\ \dots & \dots & \text{(SOC}) \quad \dots & \dots & \dots \end{cases} \tag{10}$$

$$
\upsilon\_{\rm bat} = \upsilon\_{\rm CC}(\rm SOC) - \omega\_2 \cdot \text{sgn}(\dot{i}\_{\rm bat}) - \omega\_3 \cdot \dot{i}\_{\rm bat} - \upsilon\_{\rm RC1}.\tag{10}
$$

Here, *ω*0, *ω*1, *ω*<sup>2</sup> and *ω*<sup>3</sup> represent learnable parameters. The functions *f* and *g* represent feedforward networks with their respective learnable parameters *<sup>θ</sup> <sup>f</sup>* and *θg*. We chose neural networks with one hidden layer and rectified linear unit (ReLU) activation for *f* and *g*. We varied the number of neurons in the hidden layer between 10 and 300. Both networks had two inputs, the SOC and the battery current, and one output, the ohmic resistance *R*1.

It is worthwhile recognising that, mathematically, this model combines physics-based ODEs and machine-learning-based NODEs in one equation system. The combined equations are solved simultaneously within a single numerical framework.
