Thermal Parameter and State Estimation for Digital Twins of E-Powertrain Components

The performance of powertrain components in electric vehicles is tightly intertwined with their thermal behavior. In practical applications, their temperature must be monitored and kept below certain thresholds to avoid performance drops and failure. Sensors, however, cannot always be placed at critical locations. Instead, it is possible to use numerical models to estimate relevant magnitudes during system operation. Thermal effects in electric and electronic components can be represented in a compact way using lumped-parameter equivalent circuits. These can be combined with sensor readings from the device under study to develop digital twins and use them to monitor temperatures during test and operation. In this paper, we put forward a method to generate thermal digital twins of e-powertrain elements such as power inverters. The thermal equivalent circuit equations are obtained from a general-purpose simulation software tool and optimized to enable real-time execution. Kalman filters are then used to fuse the simulation results from this model and sensor measurements of component temperatures. The proposed method provides a way to estimate the inputs and parameters of the thermal circuit and can be used to avoid the drift of the simulation away from actual component behavior. The performance of this approach is demonstrated with a simple benchmark example and the thermal equivalent circuit of a three-phase inverter.


I. INTRODUCTION
Electric vehicles (EVs) are complex engineering applications whose operation and performance are the result of the interplay of a large number of components. Most of these components themselves are multiphysics systems, with their behavior defined by the interaction of mechanical, electronic, thermal, and other phenomena [1]. This is the case of e-powertrain elements, such as batteries, inverters and electric motors, responsible for the storage and transmission of the vehicle energy to its wheels. The design and operation of e-powertrain components requires the consideration of their multiphysics effects and the coupling between them, as well as the interactions of the components with the rest of the EV and its environment.
The associate editor coordinating the review of this manuscript and approving it for publication was Gongbo Zhou. Thermal effects, in particular, have a critical impact on the behavior and durability of power electronics hardware and electric machinery [2]. The operation of each e-powertrain component must be kept within a range of admissible temperatures to avoid degraded performance and potential failure. Exceeding a certain threshold temperature can, for instance, demagnetize the permanent magnets of an electric motor or cause damage to the semi-conductors of an inverter. Direct measurements of the temperature of these components, however, are often not feasible, as sensors cannot be placed on the most critical locations in many cases [3]. A way to keep track of these critical temperatures during operation is the use of virtual sensors that retrieve results delivered by the simulation of a thermal model of the component. To enable the real-time (RT) model-based health assessment of these devices, simplified compact representations of the complex thermal behavior of the elements under study must be used, e.g., by means of model order reduction techniques [4]. Lumped-parameter thermal networks (LPTNs) are an alternative approach to obtain such RT-capable descriptions of the thermal behavior of the components [5], [6], in the form of a thermal equivalent circuit composed of elementary components such as thermal resistors, capacitors, and sources. These components stand for thermal path resistances, inertias and losses, and they are connected to each other in the form of a resistive-capacitive (RC) network. LPTNs are modular and can be easily generated using a software library of components; they have also been shown to deliver RT performance when running on platforms with limited computational resources, such as ARM-based single-board computers [7]. On the other hand, the fidelity with which they capture the real system behavior is critically dependent on the correctness of their topology and the accuracy with which their parameters are determined [8]. LPTNs allow a lower degree of detail compared to finite element models (FEM); moreover, the characterization of thermal resistances, capacities, and losses is subjected to uncertainties, e.g., those stemming from parameter variation as a consequence of component degradation [3], [9].
LPTNs can be used to introduce the consideration of thermal effects experienced by e-powertrain components into their digital twins (DTs), high-fidelity virtual models that are employed to simulate the behavior of their real-world counterparts and perform RT optimization [10] during product development, testing, and operation. Ideally, DTs can be executed in parallel with the physical systems that they represent and used to provide information about their state and performance that cannot be directly obtained in reality, e.g., the junction temperature in power electronics devices or the magnet temperature in electric motors. The two-way communication between DTs and their physical environment also allows correcting the operating point and model parameters of the numerical simulation, preventing it from drifting away from the physical system behavior due to modeling uncertainties and the accumulation of numerical integration errors. In this case, the data obtained from sensors on the physical system must be fused with the results delivered by the numerical simulation of the DT. The different varieties of the Kalman filter [11] are frequently used to this end. Methods based on Kalman filters have been used to develop state and force observers for multibody systems [12], navigation techniques for terrestrial and extraterrestrial applications [13], [14], parameter estimation solutions for nonlinear dynamics [15], and road vehicle monitoring [16], among many other applications. Using a Kalman filter to fuse results of thermal models and online measurements in power converters to monitor junction temperature has been discussed in a number of publications. In [3], the approach focused on using an estimation that relied on online measurements of the on-state voltage and related it to the junction temperature via look-up tables. Other possibilities include using indirect temperature readings to determine the junction temperature [17]; recent work along these lines [18] makes it possible to account also for input disturbances. Similar strategies can be followed to conduct the modeling and condition monitoring of other e-powertrain components, such as permanent-magnet synchronous motors, e.g., [19], [20].
In this work, we put forward a framework to enable the consideration of thermal effects in DTs of e-powertrain components, using the Kalman filter to fuse numerical simulation results and temperature readings from the physical component under study. The starting point is a LPTN of the device, generated with a circuit simulation software tool [7]. The original LPTN dynamics, formulated using dependent variables as a system of differential algebraic equations (DAEs), is transformed into a system of ordinary differential equations (ODEs) more suitable for effective state and parameter estimation using a novel method introduced in this work. This formulation enables the use of Kalman filters to estimate parameters with uncertainties using temperature measurements from the device during a preliminary tuning stage. Once the LPTN has been initially adjusted, the Kalman filter formulation can be used during operation runtime, e.g., [21], [22], to correct errors in the simulation results that stem from alterations in the original system inputs and parameters, e.g., due to component degradation, and numerical errors in the integration process. The method is not limited to the study of a particular component and was tested in the simulation of a simple LPTN benchmark example and the thermal model of an inverter for automotive applications. Results confirmed that the proposed method is able to effectively estimate the thermal parameters of e-powertrain components. It can also be used during operation, to represent component behavior and monitor critical temperatures that cannot be directly measured with sensors. The method was able to correct simulation results when the system input, e.g., thermal losses in active electronic components, was subjected to unknown variations.

II. MODELING AND ESTIMATION METHODS
The modeling and estimation methods required for the consideration of thermal effects in DTs need to deliver accurate results in an efficient way, guaranteeing the RT performance of code execution. A possible application of the concept is illustrated in Fig. 1, which shows the diagram of a System-in-the-Loop (SiTL) test bench for automotive inverters, an example of cyber-physical system (CPS) in which a physical e-powertrain inverter (a) is tested in an environment that includes virtual elements, in this case the computer simulation of the vehicle dynamics (b). Some components in this setup, such as the inverter controllers (c) or the vehicle driver (d), may be physical or virtual, depending on the testing needs. The subsystems in this assembly exchange information via a RT co-simulation interface (e), responsible for orchestrating the simulation of the virtual components and coordinating the input and output exchanges between them and the physical systems.
Relevant magnitudes, such as the junction temperature of the inverter electronic components, cannot be directly measured on the physical component [3], but can be estimated employing a DT of the inverter (f). The DT receives information from the temperature sensors mounted on the inverter and from the results delivered by the numerical simulation of the vehicle. It also features a simplified thermal model of the inverter, generated from a LPTN obtained from a general-purpose circuit simulation software (g). Data from these two sources of information are fused by a Kalman filter (h) to improve the representation of the physical inverter behavior delivered by the DT.

A. KALMAN FILTER
The discrete Kalman filter requires that the dynamics of the system to be observed is provided in the following discrete-time form Equation (1) expresses the state x at time-step k + 1 as a function of the state and the input u at the previous instant, k. Terms F and G stand for the discrete-time system and input matrices and can be considered invariant between instants k and k + 1; ω represents the system noise, which is usually assumed to be white Gaussian noise. The s sensors mounted on the plant deliver an s × 1 array of measurements o, which, in the absence of errors, could be expressed as a linear combination h s×1 of the system state and input where H and N are linear combination matrices and ν represents the sensor noise. The noise covariance matrices of the system and the measurements are Q and R, respectively. The discrete-time Kalman filter follows a predictorcorrector scheme to estimate the state at the next time instant, k + 1, from the estimated statex + k and the inputs u k at current step k [11]. The predictor yields a first approximation of the statex The estimated error covariance matrix P is propagated as where superscript () − stands for the a priori estimated values. Once these first values have been calculated, the correction step improves the predictions at time k + 1 where subscript () + now denotes a posteriori estimated values, I is the identity matrix and term K stands for the Kalman gain, evaluated as The Kalman filter is at the core of the DT ability to accurately represent thermal effects in its physical counterpart, and it plays a twofold role. In the first place, it makes it possible to adjust uncertain LPTN parameters to match hardware behavior. Second, it enables the estimation of temperature values that cannot be directly measured during operation. Figure 2 illustrates the operation of the Kalman filter inside the DT for the latter role: data from the temperature sensors (T sensors ) are fused with the results of the numerical simulation of the LPTN (T model ) to deliver the estimated system temperatures (T estimated ). The dynamics equations of the LPTN used as system model by the Kalman filter, however, are generally not in the form of Eq. (1) and must be transformed for their use in the estimation algorithm. Additionally, RT performance is a requirement in DT applications, so the resulting thermal dynamics formulation has to be both compact and efficient. The following Sections discuss how to arrive at such a formulation starting from general purpose circuit simulation equations.

B. LPTN GENERAL-PURPOSE EQUATIONS
In this work, the thermal model required by the Kalman filter in Section II-A is generated from a LPTN of the component under study. Lumped-parameter equivalent circuits are a compact way to describe the thermal behavior of e-powertrain components. They represent the heat transfer, thermal losses, and thermal inertia properties of a physical system by means of lumped components comparable to those of electric circuits. Each node in a LPTN corresponds to a representative point in the physical system and has a temperature T associated with it, which is analogous to voltage in an electric circuit; heat flows Q between nodes play a role similar to currents. Thermal conductivity and convection are represented with thermal resistors, thermal inertia is modeled with capacitors, and heat generation, e.g., Joule effect losses, is introduced in the model by means of current sources [23], [24].
The starting point for the computational methods in this paper is the modeling framework for electronic and thermal circuits introduced in [7], which represents a systematic way to assemble the dynamics circuit equations starting from its topology and component properties, although alternative descriptions could be used as well. Following this approach in the case of a thermal equivalent circuit, the variables used to describe the system are the temperature T of each node and the heat flow Q through every thermal resistor, source, and capacitor. They can be grouped in an n × 1 array of system variables where terms q T and q Q contain n T node temperatures and n Q heat flows, respectively. The n variables in q are not independent, but are subjected to m algebraic constraints imposed by the satisfaction of Kirchhoff's laws at the nodes, temperature specifications at certain nodes, and the constitutive equations of thermal resistors, namely T = QR where T is the temperature difference between the nodes connected by the resistor, Q is the heat flow through it, and R is the thermal resistance. Note that, in general, Eq. (9) is also a function of the system input, v. Thermal capacitors, in turn, introduce a set of p linear ODEs in the form where A and b are p × n and p × 1 terms. In general, circuit solvability requires that n = m + p. Together, Eqs. (9) and (10) form a system of DAEs that is suitable to describe the dynamics of a wide array of electric, electronic, and thermal circuits in a straightforward way. They can be easily generated from system description and were used in [7] as the foundation of a general-purpose forward-dynamics circuit simulator. Section III below introduces a benchmark problem to illustrate the application of this modeling approach to a simple thermal network.
Expressing the system dynamics as a DAE system, however, is not convenient for its use in DTs. Redundant variables have a negative impact on computational efficiency and would add complexity to the estimation algorithm used to fuse system dynamics and sensor information, described in section II-A. A more advantageous formulation is obtained expressing the dynamics in terms of a reduced set of variables z, via the elimination of the algebraic constraints in Eq. (9), as detailed in Section II-C.
Thermal equivalent circuits have a particular structure that can be exploited to perform this coordinate reduction and develop efficient estimation algorithms. In the first place, unlike in most electronic circuits, the algebraic constraints = 0 in Eq. (9) can be expressed as a linear combination of the system variables q and a set of r input values v that evolve as the simulation progresses where q and v are m × n and m × r matrices, respectively. It will also be assumed that term b in Eq. (10) can be expressed as where A 1 is a p × n matrix. The differential equations of a regular thermal capacitor are compatible with the use of Eq. (12). Terms q , v , A, and A 1 can be considered to VOLUME 9, 2021 remain constant during the numerical integration of the system dynamics from time instant k to the next one, k + 1, although, in fact, some elements in these matrices, such as thermal resistance values, may vary as node temperatures evolve.

C. REDUCTION TO MINIMAL VARIABLES
The coordinate reduction put forward in this Section is based on the elimination of the algebraic constraints in Eq. (9). It is conceptually similar to the velocity transformation methods commonly used in multibody system dynamics, e.g., [25], although in this case the transformation can be directly performed on the system variables given the linearity of Eq. (11). The circuit dynamics thus becomes defined by the p differential equations in (10), a reduced set of p variables, z, and the r inputs in v. The reduced variable set z could be selected in several ways; in thermal circuits, the temperature of the nodes to which the capacitors are connected, is a convenient choice. Here, we will express z as a linear combination of the dependent variables q where B 0 is a p×n matrix that will remain constant as long as the selection of independent variables and the circuit topology are not modified. Equations (13) and (11) can be grouped to form the system of equations where I p is the p × p identity matrix. Equation (14) can be solved for q if its leading matrix is regular. This reveals the requirement that B 0 must complete the row rank of term q . The inverse of the leading matrix is partitioned as where S spans the first m columns of the n × n inverse matrix in Eq. (15), and T the last p ones. This provides the expression of the coordinate reduction Matrices T and B can be interpreted as Differentiation of Eq. (16) with respect to time provides the derivatives-level expression of the transformatioṅ which can be substituted in Eq. (10) to obtain The system of ODEs in Eq. (19) expresses the dynamics of the LPTN in terms of the minimal set of variables z and the system input v and its derivatives.

D. DISCRETE STATE-SPACE REPRESENTATION
The discrete-time state-space matrices F and G required by Eq. (1) can be obtained from Eq. (19). Substituting term b from Eq. (12) and the expression of q from Eq. (16) yields = ATż+AṪz + ABv + AḂv + A 1 (Tz + Bv) = 0. (20) Equation (20) can be rearranged aṡ Grouping input v and its derivatives in a single term the p × p state and p × 2r input matrices F c and G c that correspond to the continuous state-space system equations are identified from Eq. (21) where The discrete-time counterparts F and G of the matrices in Eqs. (23) and (24) are evaluated as and τ s is the time interval between instants k and k + 1.

E. APPLICATION OF THE FILTER TO STATE AND PARAMETER ESTIMATION
The state space matrices in Eq. (27) can be directly used in the Kalman filter expression in Eq. (1) if the filter is employed to carry out the estimation of the system state. In this case, x = z.
In some cases, however, it is also necessary to deal with uncertainties that affect the thermal parameters of the system, as the exact value of some thermal parameters could be initially unknown or vary during the operation of the component under study. In such a case, system parameters could be initially adjusted by means of global optimization approaches, especially when discussing moderate-size LPTNs [26]. The Kalman filter can also be applied to the estimation of uncertain parameters, besides the system state. However, the filter formulation in Section II-D cannot directly handle such situations, as they require dealing with a new system of equations, which is nonlinear. Instead, it is possible to use the Extended Kalman Filter (EKF) to this end. These uncertain parameters can be grouped in term ρ, of size o × 1, and added to the following extended state vector Although adding state derivativesż in (29) is not mandatory, it eases the evaluation of the Jacobian matrices in the upcoming calculations.
The variables in the new state vector in Eq. (29) are no longer independent, as they must satisfy the condition = 0 imposed by Eq. (19). Therefore, the fulfillment of Eq. (19) must be imposed during the application of the extended Kalman filter. In this work, the perfect measurements approach [27] is used to this end. The vector of measurements o and term h in Eq. (2) have to be modified accordingly. Equations = 0, now referred to as perfect measurements, are added to Eq. (2) to obtain while the vector of measurements is enlarged with p zeros TermH is then defined as The evaluation of termH in Eq. (32) is made simpler if h is expressed in terms of the independent variables z and their derivatives. Term h is often a subset of the dependent variables q, because sensors mounted on thermal systems usually monitor the node temperatures or heat fluxes through components. For this reason, h can be expressed as where C is a constant s × n matrix. The expression of the differential equations in terms of the dependent variables is given in turn by Eqs. (10) and (12) (q,q) = Aq + A 1 q.
The partial derivatives of terms in Eq. (36) are straightforward in most cases; for matrices T and B the inverse matrix derivative is used together with Eqs. (15) and (16), e.g., The continuous state-space form of the dynamics with the expanded statex isẋ whereF c andḠ c stand for the new state and input matrices, respectively. Assuming that the system properties can be considered constant during an integration step, these terms can be approximated as where I n is the n × n identity matrix. The use of matri-cesF c andḠ c does not result in an exact fulfillment of Eq. (38); accordingly, the correction step of the extended Kalman filter is responsible for the satisfaction of Eq. (19). The discrete-form expression of matricesF c andḠ c can be obtained as and the Kalman filter equations (1) and (2) are rewritten as whereN is the feedthrough matrix N enlarged with p rows of zeros. The resulting Kalman filter equations then parallel the expressions in Section II-A.

1) PARAMETER ESTIMATION DURING INITIAL TUNING OF LPTNs
The approach described in Section II-E makes it possible to estimate LPTN parameters, besides the system state. This can be done at two stages in the simulation cycle. First, the method can be used for a preliminary tuning process of the model parameters, in which modeling deviations between the LPTN and the actual system properties are corrected. After this initial tuning, the filter can be used during operation runtime to keep track of variations of the system properties, performing an online adjustment of the corresponding parameters. Both approaches can be used independently from each other; in fact, the EKF online estimation can be used even if the preliminary parameter adjustment was conducted using a different optimization method, e.g., [26]. The preliminary tuning process can be performed in an iterative way. The initial set of parameters of the LPTN is ρ 0 . Then, a test run of the system under study is performed and sensor readings are fed to the Kalman filter defined by Eqs. (43) and (44). A new set of parameters, ρ 1 , is obtained as a result and used to update the LPTN properties. This procedure may have to be repeated in cases in which the convergence of the parameter values is slow. In this case, the operation continues until the difference χ between two consecutive iterations i and i + 1 converges below an user-defined threshold error , i.e., In offline parameter estimation procedures, it would be advisable to repeat the procedure starting from different initial parameter sets, ρ 0 , to ensure that the algorithm converges to the same solution. It should be pointed out that the estimation methodology in this Section requires that the number, type, and position of the sensors are compatible with the estimation goals; the observability test [28] must be satisfied. The system excitation used during parameter identification must be sufficient to identify relevant values, especially thermal capacitances, which require a transient phase as described in Sections III-B2 and IV-A2.

III. BENCHMARK PROBLEM
The methods described in Section II were tested in the simulation of the thermal dynamics of two examples. The first one is a simple thermal RC circuit that can be used as benchmark problem, shown in Fig. 3. It should be noted that this benchmark does not represent any physical system, and is intended to serve as a test case to illustrate the application of the method in Section II. The results obtained from the simulation of the benchmark are used to determine the ability of the proposed method to correct modeling errors in the system parameters and disturbances in its input. The benchmark problem also illustrates the use of the method and provides a means to replicate its results in a straightforward fashion. The circuit consists of one heat source Q 0 connected to three resistors and two thermal capacitors. The system contains four nodes, of which number 4 is assumed to represent air at a constant temperature T AIR = 300 K. The heat generated at the source has a constant value Q 0 = 10 W, resistors R 1 , R 2 , and R 3 have values of 1, 2, and 3 K/W respectively. The parameters of the capacitors are C 1 = 0.1 J/K and C 2 = 0.2 J/K and their initial temperatures are set to T 0 2 = 299 K and T 0 3 = 301 K. Temperature sensors can be placed at nodes 1, 2, and 3. Four estimation scenarios are considered: • Resistor estimation: Parameters R 1 , R 2 , and R 3 are estimated using sensors in nodes 1, 2, and 3. Initial values R 1 = R 2 = R 3 = 10 K/W are assumed for the resistances.
• Capacitor estimation: Parameters C 1 and C 2 are estimated using sensors in nodes 2 and 3. Initial values for the capacitance of these elements are C 1 = 1 J/K and C 2 = 10 J/K.
• Source parameter estimation: Q 0 is selected as uncertain parameter to be determined. An initial value Q 0 = 1 W is assumed and corrected using a single temperature sensor placed on node 3.
• State estimation with input disturbance: The full system state is estimated using temperature measurements from nodes 2 and 3. A modeling error is introduced in the heat source: the thermal model used in the estimation features a constant heat source with Q 0 = 10 W, while the actual heat generation follows a sinusoidal function, Q 0 = 10(1 + sin (10πt)) W. For the purposes of this benchmark problem, it is assumed in each scenario that only the target parameters or input are uncertain, while every other parameter in the model is accurately known. Often, however, uncertainties can be found in several parameters simultaneously. For instance, thermal resistance and capacitance parameters may need to be characterized for the same circuit. In such a case, resistors can be adjusted from the steady-state results of the component at hand, even if the capacitance values of the system are not known yet. Once the resistors have been corrected, the system capacitances can be estimated from the transient response of the physical system. This procedure is illustrated with the problem in Section IV.
In all cases, a simulation of the thermal dynamics of the circuit with exact parameters was used as reference solution and as source of sensor measurements. Reference temperatures at nodes 1, 2, and 3 are shown in Figs. 4 and 5 for the two types of heat sources, namely constant and sinusoidal. The estimation scenarios are summarized in Table 1.

A. SYSTEM MODELING
The benchmark RC thermal circuit can be modeled with a set of n = 10 dependent generalized variables q. Of these, four correspond to the temperatures of the nodes and the other six to the heat flows through the components, shown in Fig. 3. The corresponding variables in Eq. (8) for this example are The input for this system consists of the heat introduced by the source and the air temperature at node 4 so r = 2. The variables in q and the input v must fulfill m = 8 algebraic equations = 0 imposed by Kirchhoff's equations at each node, the fixed temperature of node 4, and the constitutive equations of heat sources and thermal resistors, which relate the heat flow through each component to its physical properties. The expression of Eq. (9) for this RC circuit is Finally, each thermal capacitor introduces a differential equation in the form where C is the capacitance, T a is the temperature of the node to which the capacitor is connected, and Q C is the heat flowing into the component. The two capacitors in this example introduce p = 2 ODEs in the form of Eq. (10), where terms A and b take the form The resulting system of DAEs given by Eqs. (49), (51), and (52) can be transformed into a system of ODEs through the selection of an appropriate set of minimal variables via Eq. (13). The number of independent variables matches the name of ODEs in the problem, so the temperature at the thermal capacitors is a reasonable choice Minimal variables z can be related to the generalized set q through the constant transformation matrix

1) ESTIMATION
Parameter and state estimation for this example are conducted using the methods in Section II. The timestep τ s is set to 1 ms and sensor measurements are introduced into the correction step of the filter every time a step is taken. Sensor measurements are assumed to present Gaussian noise with mean 0 K and standard deviation 0.5 K. Term R is the covariance matrix of the measurement noise, a diagonal matrix whose elements are set to 0.25 K 2 for the physical sensors and to 0 K 2 for perfect measurements. Term P is a diagonal matrix as well, with elements initially set to 10 in SI units for the parameters and 0.01 in SI units for the states. Matrix Q was adjusted to achieve a constant power spectral density (PSD) of the innovation.

B. RESULTS
The results obtained in the solution of the four problems in Section III, namely resistance, capacitance, heat source, and temperature estimation in the benchmark circuit are shown next.

1) RESISTOR ESTIMATION
System parameters, including resistance and capacitance values, must be adjusted before using the model during operation. The first estimation scenario considered involves VOLUME 9, 2021 correcting resistances R 1 , R 2 , and R 3 in the benchmark circuit. Initial values R 1 = R 2 = R 3 = 10 K/W were used as first approximation to the actual system parameters The sensor readings used in this case were the temperatures of nodes 1, 2, and 3.
These can be expressed in terms of the system independent variables and inputs, and the corresponding virtual sensors take the expression (57) Figure 6 shows the time-history of the resistance parameters as the estimation progresses. A single simulation run was sufficient to achieve convergence to all the reference values.

2) CAPACITOR ESTIMATION
The second scenario consists in the adjustment of the capacitance parameters C 1 and C 2 , Initially, C 1 = 1 J/K and C 2 = 10 J/K. The vectors of sensor measurements o and virtual sensors h in this case are Noticeable differences exist between resistance and capacitance estimation. The convergence of the capacitor parameters is slower; moreover, relevant information for this process can only be obtained during transients, as the system becomes non-observable once steady state is reached, when the heat flow through the capacitors falls to zero. Accordingly, large variations of the capacitor temperatures are required to make the parameter estimation possible, and an iterative process is likely to be necessary. In this case, an admissible error = 10 −10 J/K was set and convergence was achieved after 11 iterations. Figure 7 shows the evolution C 1 and C 2 during the procedure.

3) SOURCE HEAT ESTIMATION
The purpose of this test scenario is the correction of input disturbances. The constant heat source in the LPTN is initially assumed to deliver Q 0 = 1 W, when its actual value is Q 0 = 10 W. The problem is addressed performing a parameter estimation, in which Sensor readings include only the temperature at node 3.
(63) Figure 8 shows the estimation results for input Q 0 and its residual from t = 4 s to t = 10 s.

4) STATE ESTIMATION WITH INPUT DISTURBANCE
The final numerical experiment with the RC thermal circuit consists in the estimation of the system state when the input is subjected to unknown disturbances. The model used in the estimation assumes a constant heat input at the source Q 0 = 10 W, whereas the actual heat generation follows the expression Q 0 = 10(1 + sin(10πt)) W. The unknown input is treated as a parameter, Two temperature sensors were placed at nodes 2 and 3.   Figure 9a compares the temperature of the capacitor 1, T 2 , obtained with the state estimation method to the reference solution delivered by the simulation of the system dynamics with exact parameters and input. The plot also shows the value of T 2 obtained in the simulation of the circuit dynamics if the input disturbance is not corrected. Figure 9b contains the residual of the temperature of node 2.
The computations required for the solution of this problem were performed on two different platforms, namely  Table 2. These selected platforms can be integrated in an application like the one depicted in Fig. 1.
The GNU Compiler Collection (GCC) version 10.2.0 was selected to build the Linux executables on Kubuntu, whereas FIGURE 9. RC circuit: Temperature at node 2, T 2 , with heat generation Q 0 = 10(1 + sin(10πt )) W and its residual.   Table 3 shows the elapsed times in the solution of a 5-s state estimation of case 4 (State estimation with input disturbance) of the benchmark problem. The RPi4 was able to perform almost 15 times faster than RT, whereas the Laptop completed the estimation around 86 times faster than RT.

IV. INDUSTRIAL EXAMPLE: THREE-PHASE INVERTER
The estimation methods in Section II were also applied to a three-phase inverter for automotive applications, shown in Fig. 10.   An inverter is an electronic control unit (ECU) that converts direct current (DC) into alternating current (AC). Energy conversion is performed by commuting output potentials between DC voltage terminals and producing a moving average value that is applied to the load. Crucial components in this ECU are the power devices used to perform high voltage commuting under variable current loads at high frequency; this activity causes considerable heat losses that need to be dissipated.
The power modules in this research evacuate heat through a cooled aluminum heatsink on which three direct-bonded copper (DBC) substrate layers are mounted [29]. Each DBC layer supports an inverter phase that contains two MOSFET blocks. An overview of the power module structure and material stack-up are shown in Figs. 12 and 11, respectively. Figures 13 and 14 show the thermal equivalent circuits of a single branch and the heatsink and coolant part of the inverter, respectively. Each MOSFET block is modeled with a heat source Q i , where i = 1, . . . , 6, which represents its thermal losses, and a resistor R die that stands for its thermal resistance. Due to its relatively small mass, the capacitance of the MOSFET block was neglected. The DBC is represented using a resistor R dbc and a thermal inertia C dbc . The welding   between each DBC and the heatsink is a thin layer of silver paste represented by R sp .
The last part of the inverter, the heatsink, is made up of two aluminum blocks. The first one is solid and represented by R hs and C hs , whereas the one in contact with the coolant is a pin-fin block defined by R w and C w .
The LPTN of this inverter includes 14 nodes and 23 components: 6 heat sources, 12 resistors and 5 capacitors. When modeled with dependent variables, the thermal dynamics is described by a system of DAEs with 5 differential and 32 algebraic equations, in which n = 37, p = 5, m = 32. The number of input values is r = 7, including the heat generation at each MOSFET block and the temperature of the refrigerant.
The estimation of junction temperatures is an important application of LPTNs [3], [17], [18]. If this temperature rises above admissible levels the inverter performance degrades and may eventually lead to permanent damages in the component. Temperature sensors, however, cannot be placed at the MOSFET junction. In the majority of commercial power modules, temperature sensors are placed on the copper layer, at the points labeled S 1 , S 2 , and S 3 in Fig. 12. The junction temperature can be estimated from these readings using the methods in Section II and used later as input for temperature control methods, e.g., [30], [31].

5) REFERENCE SOLUTION
A reference solution was generated for this example using a CFD simulation of the inverter. For the purposes of this study, this solution is considered to be exact. The heat losses at each MOSFET block had a constant value Q 0 = 208 W; the refrigerant temperature was T water = 343.15 K.

6) LPTN ADJUSTMENT
The LPTN that represents the thermal behavior of the inverter needs to be adjusted so that it matches the reference solution. Once a topology is selected for the equivalent thermal circuit, initial values of its R and C parameters are assigned based on the physical properties of the components. Due to modeling uncertainties, these initial values may not exactly represent the actual ones necessary to describe the system dynamics. A first use of the estimation methods in Section II is the determination of the values of the resistors and capacitors that need to be used in the LPTN. During this initial tuning phase, additional temperature sensor readings, other than the ones at points S 1 , S 2 , and S 3 , are used. It is possible to use extra sensors during the characterization of the component in a test bench; however, these will not be available during regular operation of the component.
In all estimations of this example, the covariance matrix of the measurement noise R is a diagonal matrix whose elements are set to 0.25 K 2 for the physical sensors and to 0 K 2 for perfect measurements. Term P is a diagonal matrix as well, with elements initially set to 10 in SI units for the parameters and 1 in SI units for the states. Matrix Q was adjusted to make the PSD of the innovation constant.

7) JUNCTION TEMPERATURE ESTIMATION
Once the LPTN parameters have been adjusted, the equivalent circuit can be used to estimate the junction temperature of the inverter during operation. Four scenarios are considered:  shown in Fig. 15.
• Case 3: MOSFET heat losses depend on the junction temperature T j as shown in Fig. 16.
• Case 4: The heat losses at the MOSFETs are constant and equal to Q 04 = 600 W, and the temperature of the refrigerant evolves according to the expression 306.15 − 13e −0.75t K. Temperature estimation during operation relies only on sensor measurements at points S 1 , S 2 , and S 3 , which are the only readings available from the point of view of the DT of the inverter.

A. RESULTS
The resistors and capacitors of the inverter must be adjusted prior to the use of the LPTN during operation inside a DT.
In this section, the extended Kalman filter is first used to adjust the thermal parameters of the inverter, starting from a set of values determined using heat transfer formulas. Then, the adjusted thermal circuit is used during operation to estimate the junction temperature of the MOSFET blocks, using temperature sensors placed on the accessible nodes of the components.

1) RESISTOR ESTIMATION
As mentioned in Section IV, results from the CFD simulation of the inverter are used as reference values in this example and considered an exact solution. During the parameter-adjustment stage, additional sensors, other than the ones placed at S 1 , S 2 , and S 3 , are required to estimate the sought parameters. This is analogous to the instrumentation of a physical inverter on a test bench during its characterization phase. To keep the estimation process realistic, we avoided placing these sensors at nodes where it would have been difficult to install them on the physical component, such as the MOSFET junction (nodes [1][2][3][4][5][6] or the silver plate between the DBC and the heatsink (node 10). For the characterization of LPTNs in Figs. 13 and 14 three sensors were placed at nodes 7, 11, and 12, namely the copper layer on the DBC and the upper and lower parts of the heatsink. The measurements were assumed to have a Gaussian noise with mean 0 K and standard deviation 0.5 K as in section III. It must be mentioned that, with these sensors, the values of R die and R sp are not observable and cannot be corrected via estimation with the Kalman filter.
Initial values for the resistors were determined using only geometry and material properties [32] as where e is the thickness of the material, k is the thermal conductivity and A is the cross section of the considered component.
The resistance values yielded by Eq. (67) will not generally match the actual properties of the inverter components. In the first place, Eq. (67) assumes that all the heat flow is perpendicular to the component section, which is often not the case. Moreover, the thermal and geometrical properties of the inverter elements are subjected to uncertainty and cannot be determined with absolute accuracy. Accordingly, the starting values delivered by Eq. (67) need to be corrected to describe the system dynamics appropriately.
The initial set of resistance values was improved through estimation with the Kalman filter. A 5-s simulation of the system dynamics during estimation case 1 was carried out to this end. In order to tune the resistors, only steady-state readings of the system magnitudes were used. The circuit capacitors are not yet adjusted in this stage, and they introduce deviations from the actual system behavior during transients. For this reason, only sensor measurements between t = 4 s and t = 5 s were used.   An iterative procedure was necessary to ensure the convergence of the resistance parameters below an admissible threshold < 10 −10 K/W; the convergence is shown in Fig. 17.
Only for comparison purposes, the CFD data are used here as well to calculate the equivalent resistors that would fulfill Fourier's Law between each pair of nodes of the LPTN as where T i and T j are the temperatures at the pair of nodes i and j, R ij is the equivalent resistor between these nodes, and Q ij is the heat flow through the resistor in steady-state. It should be stressed that these values are not used during the estimation process.
The resistance parameters before and after estimation are shown in Table 4. Resistors R die and R sp could not be adjusted during estimation and their values were left unchanged.
The EKF estimation procedure may not converge depending on the starting values determined using Eq. (68). Table 5 summarizes the convergence limit of the initial parameter set. It is possible to achieve convergence starting from thermal resistance values about 50 times greater than the real values or one or two orders of magnitude smaller.

2) CAPACITOR ESTIMATION
After the correction of the circuit resistors, capacitors C dbc , C hs , and C w in Figs. 13 and 14 were adjusted with the Kalman filter. This adjustment is not possible using steady-state sensor readings, as they are not affected by capacitance values, so measurements during transients must be used instead. Each capacitor was tuned using the readings from the closest sensor; the length of the transient necessary to perform the estimation was determined by the evolution of the node temperature. Again, an iterative process was required to achieve convergence; the threshold error was = 10 −10 J/K.
The sensors used to adjust resistors and capacitors were the same. Initial capacitance values were calculated as where m i is the mass associated to node i, and c pi is the specific heat of the material. Figures 18 and 19 show the convergence of the adjustment process of capacitors C dbc and C w . The initial and corrected capacitance values are displayed on Table 6. Table 7 shows the effect of initial capacitance values on the convergence of the capacitor estimation. Admissible values range between 20-50 times greater and 100 times smaller than the true ones. It has been observed, however, that the number of iterations required to achieve convergence increases for large differences between the actual value and the starting point.

3) JUNCTION TEMPERATURE ESTIMATION DURING OPERATION
Once the system parameters have been adjusted, the LPTN can be used as thermal DT of the inverter during operation. The four cases in Section IV-7 were used as test scenarios. VOLUME 9, 2021 FIGURE 21. Estimation of the junction temperature of the inverter and its residual using a sensor on the copper layer for case 1.
Only sensors placed on the DBC, at nodes S 1 , S 2 and S 3 , which are actually mounted on the inverter during operation, were used to estimate the junction temperature of the MOS-FETs. The sensors are considered to have a Gaussian noise with mean 0 K and standard deviation 0.5 K. Figure 21a shows the junction temperature obtained during a 5-s simulation of the circuit dynamics with the constant value of Q 0 = 208 W used in case 1. In this case there are not input disturbances and heat losses at the MOS-FET blocks are assumed to be known accurately. Both the direct forward-dynamics of the LPTN after correction of its parameters and the estimation with Kalman filter were able to follow the reference value of T 1 obtained with CFD simulation. Figures 22 and 23 represent the simulation results obtained in test cases 2 and 3, in which the input heat losses are no longer constant, but are functions of time and temperature as defined in Eqs. (65) and (66). Figure 24 presents the simulation in test case 4, with constant heat losses and a variable refrigerant temperature.
The estimation method was able to appropriately handle the uncertainty in Q 0 from the readings of the sensors mounted on the system. The direct simulation of the circuit dynamics is unable to follow these changes, even after adjusting the circuit parameters.
It is worth mentioning that resistances R die and R sp could not be adjusted prior to operation due to the lack of appropriate sensor readings. In spite of this, the estimation of the  junction temperature in all cases shows a reasonably low error. The obtained results confirm that the estimation methods in Section II can be used to overcome the effect of parameter and input uncertainties in the simulation or thermal equivalent circuits. In particular, when appropriate sensor readings are available, input disturbances can be accounted for in real-time during component operation.  Table 8 shows the times elapsed in the solution of the four junction temperature estimation scenarios. These results confirm that the estimation method used is compatible with its use in real-time applications with the computing platforms described in Table 2.

V. CONCLUSION
Monitoring the thermal behavior of electronics components in powertrains makes it possible to improve their performance while avoiding excessive temperatures that could lead to their malfunction and damage. In most cases, however, sensors cannot be directly placed on critical locations. LPTNs, together with appropriate estimation techniques, can be used to develop digital twins of e-powertrain components and keep track of these relevant temperatures during system operation.
Efficient LPTNs of e-powertrain components can be obtained with the methodology described in this paper, starting from a general-purpose formulation of the circuit dynamics based on dependent variables. This formulation enables the simple definition and assembly of individual circuit components, such as thermal resistors and capacitors, establishing their thermal parameters from the nature of the physical properties of the elements that they represent. The dynamics equations thus formulated are later transformed into a minimal set of differential equations that can be used to develop computationally efficient estimation methods.
An input, parameter, and state estimator was put forward in this paper using the above-mentioned formulations and the Kalman filter. The proposed method can be used in two stages. Prior to the operation of the component, the parameters of the LPTN can be estimated and adjusted to match the behavior of the system that they represent. Once this stage is complete, the estimation method can be used to handle input disturbances and accurately monitor relevant temperatures in the component under surveillance, fusing information coming from both the LPTN that represents the system and sensors mounted on the actual device. The methods were tested in the simulation of a benchmark RC thermal circuit and the thermal model of an automotive inverter. Results confirmed the ability of the proposed estimation approach to provide meaningful information about component temperatures, even in the presence of significant input disturbances.