*3.3. Data-Driven ANN-Based Thermal Model*

In comparison to the physics-based approach, a data-driven model is implemented by means of an ANN shown in the right part of the thermal model in Figures 1 and 4a. ANNs mimic the information processing in human brains by modeling of the nonlinear input-output-relations, which explicitly occur in battery cells [29,62]. Their main advantage is that complex correlations do not have to be physically modeled as networks can be trained to represent the correlations. It is, therefore, necessary to provide the data basis that includes the data correlations to be trained.

Regarding the model architecture and implementation, a network consists of a number of neurons that are arranged in layers. The neurons are connected via edges that contain weights that indicate the strength of the connection. In every neuron, its weighted inputs and a bias are summed, and the sum is mapped, in a nonlinear manner, to the output by the activation function [29,54,62] in Equation (6).

$$y\_j = f\left(\sum\_{i}^{n} w\_i \cdot x\_i + b\_j\right) \tag{6}$$

In Equation (6), *xi* are the inputs to one neuron, *wi* are the respective edge weights of the inputs, *bj* is the bias in the neuron, *f* is the activation function and *yj* is the neuron's output. In the training process the weights and biases are updated using known output results. The goal is to minimize the difference between the network output and the target data. The difference is mostly described by the Mean Squared Error (MSE) and is termed the loss function. Several optimizations exist in the literature for minimizing the loss function.

The total ANN thermal model developed in this work is depicted in detail in the righthand section of Figure 4a. As already mentioned, the implementation of an ANN a dataset containing the input–output correlations to be learned is necessary. The present network is trained based on a dataset generated by the reference system described in Section 3.1. The underlying load profile contains different static (constant charge/discharge) and dynamic load profiles (e.g., the ECE, EUDC, US06, RTS95, FTP72, Artemis Motorway cycles), as well as fast charging and cooling sections without load. In order to simulate varying ambient and cooling conditions, the dataset is generated for different starting temperatures of 15–45 °C in steps of 5 °C leading to a total of over 273 k timesteps. A dataset provides information of current, SOC, heat generation in cell and electronics, the local temperature of electronics, terminal and core as well as the removed heatflux by cooling for every second. The network inputs are scaled in a range between 0 and 1 using the minimum and maximum values of each feature in the training dataset. This makes the later training more robust and efficient [9,33] and prevents it from putting more emphasis on signals with higher absolute value [45].

The network architecture consists of one input layer, one hidden layer and one output layer. The NARX architecture is implemented for the situation of an cell equipped with electronics. As characteristic of the NARX as recurrent network, the outputs are fed back to the input layer. In contrast to conventional FF networks, this enables the representation of temporal dynamics, which improves the modeling of the thermal cell behavior. Thus, the outputs of different timesteps *y*(*t* − 1), *y*(*t* − 2)... , *y*(*t* − *d*Output) are stored in a Tapped Delay Line (TDL) and used as inputs for the current timestep *y*(*t*). In the same manner, the inputs form different timesteps *x*(*t*), *x*(*t* − 1), *x*(*t* − 2), ... , *x*(*t* − *d*Input), which are stored in a TDL and used as inputs to calculate the output *y*(*t*) at the current timestep. *d*Input and *d*Output are the maximum backward timesteps stored in the TDL of the inputs and outputs, respectively [33]. The activation function used for the hidden layer is the Rectified Linear Unit (ReLU) function (Equation (7)):

$$f(\mathbf{x}) = \text{Re}\,\text{L}\,\text{U}(\mathbf{x}) = \max(0, \mathbf{x}) = \begin{cases} \text{ x} & \text{if } \mathbf{x} \ge \mathbf{0} \\\ \mathbf{0} & \text{if } \mathbf{x} < \mathbf{0} \end{cases} \tag{7}$$

The ReLU function is advantageous because of its lower computing time requirements, compared to other activation functions, such as logsig or tansig [62], which makes it more suitable for the current application in a vehicle BMS.

The main advantage of the NARX approach compared to other data-driven regression networks is the network architecture. A NARX network is implemented with neurons and a structure as simple as a FF network. Therefore, it can be trained with the fast and accurate FF training procedures and algorithms with good convergence. The training algorithm used in this work is the Levenberg-Marquardt (LM) algorithm, which offers a fast convergence for small networks [29]. The network is trained open-loop and independent of the other two submodels, meaning that the loop from the outputs to the inputs is opened by utilizing the known target temperatures. The open-loop configuration allows to efficiently train the NARX net, analogous to FF nets and stable inputs are available [33]. This is the main advantage compared to other recurrent network approaches.

Important features influencing the training time and especially the accuracy of the results are the NARX hyperparameters, such as number of hidden neurons or input delays. In order to determine a suitable architecture for the network, the authors applied the gridsearch method [63], meaning that the number of input and output delays and the number of neurons on the hidden layer are varied between 0 to 10, 1 to 10 and 3 to 10 respectively. The span of the parameters was found with prior investigations on testing many parameters on a large scale. For measuring the quality of the current network topology, another independent validation dataset containing different profiles to the training dataset is used. The network with the lowest MSE on the validation set is used as the current best configuration at the initialization by chance. For this application, a net is chosen, which consists of seven neurons on the hidden layer, and TDLs lengths of 7 and 3 for the inputs and outputs respectively. The net and training parameters are summed up in Table 2. In order to avoid extrapolation scenarios, the training profiles are chosen and combined in a way that the physically possible limits of SOC, cell voltage and load are reached. The total dataset generated is split into 70%, 15% and 15% for the training, validation and testing, respectively. In order to avoid overfitting, the early-stopping method is used by means of stopping the training if the MSE on the validation dataset increases in six consecutive epochs [33]. The maximum number of epochs is limited to 150, whereby an epoch is one representation of the total training dataset with adaptation of the weights afterwards [45]. The whole setup and training of the network is performed utilizing the MATLAB Deep Learning Toolbox.


**Table 2.** Parameters for the neural network applied as thermal model.

## *3.4. BEV Integration and System Level Simulation*

In order to compare the two modeling approaches, the two thermal submodels are integrated into the presented model framework, including electrical and heat generation submodels. There is a need to avoid drifting of the total model, as the three submodels are strongly intercoupled. An observer is, therefore, included, as shown by the components in gray color in Figure 1. Generally, the observer compares estimated and measured values and the difference is fed back to adopt the estimation [64]. A few approaches can be found in the literature which make use of an observer to estimate the battery cell core temperature by measuring the surface temperature of a battery cell [64–66]. In this work, a different observer structure is implemented that compares the temperatures measured and estimated at the electronics *T*elec and a terminal *T*term. The difference in the electronics' temperatures *T*elec,Sim − *T*elec,Meas is used to update the heat generation at the electronics *Q*˙ elec and the difference in the terminal temperatures *T*term,Sim − *T*term,Meas for adaption of heat generation in the jelly roll *Q*˙ gen.

Obviously, there are multiple cells in a battery system that require multiple single cell models. The cells in the system thermally interact with each other [67], and this needs to be considered in system-level modeling. To achieve a fast computing system level simulation, a possible coupling scheme is presented in Figure 5. Temperatures at the boundary of the cell model are used as a boundary condition between the individual cell models connected in series. The coupling can be performed by temperature signal routing instead of full physical coupling to reduce the computational effort. In the system simulation approach, based on single cell models, either the TECM, or the ANN, or another compatible cell-level model, can be used at any time. Possible system representations are that every cell within a module receives data from the case and terminal temperatures of its neighboring cells in order to represent the thermal interactions within a module. The cells at the border of the modules can be assumed to be adiabatic or are also coupled. The modeled boundary conditions depend on the specific application. Overall, the approach is able to represent the thermal coupling or cooling conditions in state-of-the-art battery systems. Nevertheless, system simulation is an ongoing field of research and part of future work.

**Figure 5.** System simulation approach based on thermal coupling of multiple cell models via busbar and casing connections.
