Physics-informed neural networks for predicting gas flow dynamics and unknown parameters in diesel engines

This paper presents a physics-informed neural network (PINN) approach for monitoring the health of diesel engines. The aim is to evaluate the engine dynamics, identify unknown parameters in a “mean value” model, and anticipate maintenance requirements. The PINN model is applied to diesel engines with a variable-geometry turbocharger and exhaust gas recirculation, using measurement data of selected state variables. The results demonstrate the ability of the PINN model to predict simultaneously both unknown parameters and dynamics accurately with both clean and noisy data, and the importance of the self-adaptive weight in the loss function for faster convergence. The input data for these simulations are derived from actual engine running conditions, while the outputs are simulated data, making this a practical case study of PINN’s ability to predict real-world dynamical systems. The mean value model of the diesel engine incorporates empirical formulae to represent certain states, but these formulae may not be generalizable to other engines. To address this, the study considers the use of deep neural networks (DNNs) in addition to the PINN model. The DNNs are trained using laboratory test data and are used to model the engine-specific empirical formulae in the mean value model, allowing for a more flexible and adaptive representation of the engine’s states. In other words, the mean value model uses both the PINN model and the DNNs to represent the engine’s states, with the PINN providing a physics-based understanding of the engine’s overall dynamics and the DNNs offering a more engine-specific and adaptive representation of the empirical formulae. By combining these two approaches, the study aims to offer a comprehensive and versatile approach to monitoring the health and performance of diesel engines.


Introduction
Powertrains of the future must meet increasingly stringent requirements for emissions, performance, reliability, onboard monitoring, and serviceability.Capable system models for estimating states and adapting to an individual system's behaviour are critical elements to meet control and health monitoring needs.Leveraging purely data-driven models to meet these requirements provides simplicity in modelling and captures dynamics difficult to formulate analytically.However, large data needs, poor physical interpretability, challenges with systems with long memory effects and sparse sensing, as well as inability to extrapolate beyond the training datasets present onerous burdens to practical implementation.Relying on purely theory-based models allows for directly interpretable results with higher confidence and fewer data for calibration but often causes a tradeoff of modelling relevant dynamics versus model complexity, challenges in systems with high uncertainties, poor modelling where dynamics are not well understood, and slow solution of higher-order models.Modelling solutions that leverage the strengths of theory-guided as well as data-driven models have the potential to reduce data needs, increase robustness, and effectively use theoretical and practical knowledge of the system.
To investigate model architectures, balancing the strengths of both theory-based models and data-driven models, this work explores the application of physics-informed neural networks (PINNs) to a diesel internal combustion engine model for the purposes of simultaneous parameter and state estimation.The physical portion is based on the mean value model of a diesel engine with a variable geometry turbocharger (VGT), and exhaust gas recirculation (EGR) proposed by Wahlström and Eriksson [24].
Physics-informed Neural Networks (PINNs) [21] is a new method of training neural networks, which takes into account the physics of a problem while evaluating the parameters of the neural network.The method is suitable for both evaluation of the solution of PDF (forward problem) and the data-driven identification of parameters of PDF (inverse problem).It takes advantage of automatic differentiation [1] in formulating a physical loss in the loss function along with data loss.Jagtap et al. [12] proposed conservative PINNs (cPINNs) for conservation laws, which employs domain decomposition with a PINN formulation in each domain.Further, Jagtap and Karniadakis [10] introduced domain decomposition for general PDEs using the socalled extended PINN (XPINN).hp-VPINN is a variational formulation of PINN with domain decomposition proposed by Kharazmi et al. [14].Meng et al. [20] proposed the Parareal PINN (PPINN) approach for long-time integration of time-dependent partial differential equations.The authors of [5] proposed "separable" PINN, which can reduce the computational time and increase accuracy for high dimensional PDEs.In PINN, there are multiple loss functions, and the total loss function is given by the weighted sum of individual losses.McClenny and Braga-Neto [19] proposed a self-adaptive weight technique, which is capable of tuning the weights automatically.PINN and its variants were also considered in various inverse problems like supersonic flows [13], nano-optics and metamaterials [4], unsaturated groundwater flow [7].Detailed reviews of PINN can be found in [3,6,17].
Modelling of diesel engines using neural networks has been considered in the past.Biao et al. [2] considered Nonlinear Auto-Regressive Moving Average with eXogenous inputs (NARMAX) method for system identification of locomotive diesel engines.The model has three inputs to the network, i.e. the fuel injected, the load of the main generator, and the feedback rotation speed (from the output); the outputs are rotation speed and diesel power.The authors considered Levenberg-Marquardt (LM) algorithm to train the network.Finesso and Spessa [8] developed a three-zone thermodynamic model to predict nitrogen oxide and in-cylinder temperature heat release rate for direct injection diesel engines under steady state and transient conditions.The model is zero-dimensional, and the equations can be solved analytically.Thus, it required a very short computational time.Tosun et al. [23] predicted torque, carbon monoxide, and oxides of nitrogen using neural networks (3 independent networks) for diesel engines fueled with biodiesel-alcohol mixtures.The authors considered three fuel properties (density, cetane number, lower heating value) and engine speed as input parameters and the networks are optimized using the Levenberg-Marquardt method.The authors observed that neural network results are better than the least square method.González et al. [9] integrated a data-driven model with a physics-based (equation-based) model for the gas exchange process of a diesel engine.The authors modelled the steady-state turbocharger using a neural network.Further, the authors integrated the data-driven model with an equation-based model.Recently, Kumar et al. [16] considered DeepONet [18] to predict the state variable of the same mean value engine model [24] we considered in this study.The authors consider dynamic data to train the model.However, the model can predict only the state variable at the particular (trained) ambient temperature and pressure, as variations of ambient temperature and pressure are not considered in the training of DeepONet.The model also does not predict the parameters of the engine model.While the model was trained using dynamic data, the physics of the problem was not considered while training the network.The model (DeepONet) is capable of predicting dynamic responses.
In the present study, we formulate a PINN model for the data-driven identification of parameters and prediction of dynamics of system variables of a diesel engine.In PINN, the physics of the system is directly included in the form of physics loss along with data loss.While data-driven models require large amount over the entire operational range in training, PINN can be trained with a smaller amount of data as it is trained online.The dynamics characteristic of the state variables is automatically incorporated.PINN may be used for the solution of differential equations or for the identification of parameters and prediction of state variables.
In the present study, we are specifically interested in estimating unknown parameters and states when we know a few state variables from field data.The dynamics of the state variables of the mean value engine [24] are described by first-order differential equations.We will utilize these equations in the formulation of the physics-informed loss function.The unknown parameters are considered trainable and updated in the training process along with the neural network parameters.
The engine model also considers a few empirical formulae in its formulation.These equations are engine-specific, and the coefficients of these equations need to be evaluated from experimental data.These equations are static in nature, and thus may be trained with smaller data compared to dynamic equations.We know that deep neural networks (DNNs) are universal approximators of any continuous function, thus, DNNs may be considered more general approximators of these empirical formulae.One of the advantages of considering DNNs over empirical formulae is that we do not need to assume the type of non-linearity between the input out variables.The neural network learns the non-linearity if trained with sufficient data.We approximate the empirical formulae using DNNs and train them using laboratory test data.Once these networks are trained using laboratory test data, these are considered in the PINNs model in places of the empirical formulae.During the training of the PINNs model, the parameters of these networks are remain constant.
The training data for the inverse problem and laboratory data are generated using the Simulink file [22] accompanied in [24].The input to Simulink is taken from actual field data.By doing this, we are trying to generate data as realistic as field data.Furthermore, we also consider noise to the field data generated.We observed that the proposed PINNs model can predict the dynamics of the states and unknown parameters.We summarize below a few of the salient features of the present study: 1. We formulated PINNs-based parameter identification for real-world dynamical systems, in the present case, a diesel engine.This is significant as it started a new paradigm for future research for onboard systems for the health monitoring of engines.
2. We showed how PINNs could be implemented in predicting important unknown parameters of diesel engines from field data.From these predicted parameters, one can infer the health and serviceability requirements of the engine.
3. We showed the importance of self-adaptive weights (given the fast transient dynamics) in the accuracy and faster convergence of results for PINNs for the present study.
4. The engine model generally considers empirical formulae to evaluate a few of its quantities.These empirical formulae are engine-specific and require lab test data for the evaluation of the coefficients.We have shown how neural networks can be considered to model the empirical formulae.We have shown how we can train these networks from lab-test data.This is important as it may provide a better relationship for the empirical formulae.
5. The field data for the inverse problem are generated considering input recorded from actual engine running conditions.Further, we consider appropriate noise in the simulated data, mimicking near real-world field data.
We organize the rest of the article as follows: in section 1.1, we discuss the detailed problem statement and different cases considered for simulation studies.In section 2, first, we discuss PINNs for the inverse problems for the diesel engine and the surrogates for the empirical formula.We discuss a detailed flow chart for the inverse problem for the PINN engine model in section 2.2.In section 2.3, we discuss the laboratory data required and their generation for the training of surrogates for the empirical formulae.We also discuss the field data generation for the inverse problem.We present the results and discussion in section 3. The conclusions of the present study are discussed in the section 4.

Problem setup
In this section, we first introduce the mean value model for the gas flow dynamics [24] in the diesel engine, and then we will formulate the inverse problems that we are interested in.
As shown in Fig. 1, the engine model considered in the present study mainly comprises six parts: the intake and exhaust manifold, the cylinder, the exhaust gas recirculation (EGR) valve system, the compressor and the turbine.More details on each engine part can be seen in Appendix B. We note that the engine considered here is the same as in [24].
Fig. 1: Schematic diagram of the diesel engine: A schematic diagram of the mean value diesel engine with a variable-geometry turbocharger (VGT) and exhaust gas recirculation (EGR) [24].The main components of the engine are the intake manifold, the exhaust manifold, the cylinder, the EGR valve system, the compressor, and the turbine.The control input vector is u = {  ,   ,   }, and engine speed is   .(Source: Figure is adopted from [24]) To describe the gas flow dynamics in the engine illustrated in Fig. 1, e.g., the dynamics in the manifold pressures, turbocharger, EGR and VGT actuators, a mean value model of the diesel engine with variable geometric turbocharger and exhaust gas recirculation was proposed in [24].We will also utilize the same model as the governing equations to describe the gas flow dynamics considered in the current study.Specifically, the model proposed in [24] has eight states expressed as follows: where   and   are the intake and exhaust manifold pressure, respectively,   and   are the oxygen mass fractions in the intake and exhaust manifold, respectively,   is the turbo speed; ũ represents the VGT actuator dynamics.A second-order system with an overshoot and a time delay is used to represent the dynamics of the EGR-valve actuator.The model is represented by subtraction of two first-order models, ũ1 and ũ2 , with different gains and time constants.Further, the control inputs for the engine are u = {  ,   ,   } and the engine speed is   , in which   is the mass of injected fuel,   and   are the EGR and VGT valve positions, respectively.Furthermore, the position of the valves, i.e.,   and   , may vary from 0% to 100%, which indicates the complete close and opening of the valves, respectively.The mean value engine model is then expressed as In addition, the states describing the oxygen mass fraction of the intake and exhaust manifold, i.e.,   and   , are not considered in the present study as the rest of the states do not depend on these two states.Also, the parameters of the oxygen mass fractions are assumed to be constant and known.The governing equations for the remaining six states are as follows: Two additional equations used for the computation of   in Eq. ( 4) read as: where  1 is the temperature when the inlet valve closes after the intake stroke and mixing, and   is the residual gas fraction.A brief discussion on the governing equations of the engine model is presented in Appendix B. Interested readers can also refer to [24] for more details.
In the present study, we have field measurements on a certain number of variables, i.e.,   ,   ,   , and   as well as the inputs, i.e., u and   , at discrete times.Further, some of the parameters in the system, e.g.,   ,   , ℎ  and   , which are difficult to measure directly, are unknown.  is the maximum effective area of the EGR valve,   is the compensation factor for non-ideal cycles, ℎ  is the total heat transfer coefficient of the exhaust pipes and   is the maximum area in the turbine that the gas flows through.From the field prediction of these parameters, we can infer the health of the engine; a higher deviation from their design value may indicate a fault in the system.We are interested in (1) predicting the dynamics of all the variables in Eqs. ( 3)- (10), and (2) identifying the unknown parameters in the system, given field measurements on   ,   ,   , and   as well as Eqs.( 3)- (10).We refer to the above problem as the inverse problem in this study.Specifically, the following cases are considered for a detailed study: In the present study, we consider self-adaptive weights [19] (discussed in section 2 and Appendix A) in our loss function.We study the above four cases using self-adaptive weight.In order to understand the effect and importance of self-adaptive weights in the convergence and accuracy of results, we consider one more case without self-adaptive weight, Case 5 Prediction of dynamics of the system and identification of 4 unknown parameters   ,   , ℎ  and   with clean data of   ,   ,   , and   without self-adaptive weights.
The results of Case 1 and Case 2 are presented in Appendix G. First, we study the results of Case 3 and Case 5 to understand the accuracy and convergence of PINN method and the importance of self-adaptive weights.Then, we study the results of Case 4. The results for Case 3, Case 4 and Case 5 are discussed in section 3.

Methodology
We consider to employ the deep learning algorithm, particularly, the physics-informed neural networks (PINNs), to solve the inverse problem discussed in section 1.1.To begin with, we first briefly review the basic principle of PINNs, and then we discuss how to employ PINNs for the present inverse problem.

PINNs for inverse problems in the diesel engine
We first briefly review the PINNs [10,12,14,20,21] for solving inverse problems, and then we introduce how to employ the PINNs to solve the specific problem that we are of interest for the diesel engine.As illustrated in Fig. 2, the PINN is composed of two parts, i.e., a fully-connected neural network which is to approximate the solution to a particular differential equation and the physicsinformed part in which the automatic differentiation [1] is employed to encode the corresponding differential equation.Further,  represents the unknowns in the equation, which can be either a constant or a field.In particular,  are trainable variables as the unknowns are constant, but they could also be approximated by a DNN if the unknown is a field.The loss function for solving the inverse problems consists of two parts, i.e., the data loss and the equation loss, which reads as: equation loss (11) where θ denotes the parameters in the DNN;  and  represent the number of measurements and the residual points, respectively; ŷ(  ; θ) denotes the prediction of DNN at the time   ; (  ) is the measurement at   , and  (  ; θ; ) represents the residual of the corresponding differential equation, which should be zero in the entire domain.By minimizing the loss in Eq. ( 11), we can obtain the optimal parameters, i.e., θ, of the DNN as well as the unknowns, i.e., , in the system.In the present study, we have a few empirical equations that we approximate using DNNs.These DNNs are trained first using data and considered in place of these empirical formulae.We fixed the parameters of these networks when we minimized the loss function for the PINN model.Furthermore, note that here we employ the system described by one equation as the example to demonstrate how to use PINNs for solving inverse problems.For the system with more than one equation, we can either utilize an DNN with multiple outputs or multiple DNNs as the surrogates for the solutions to differential equations.In addition, a similar idea can also be employed for systems with multiple unknown fields.The loss function can then be rewritten as where  and  denote the number of variables that can be measured as well as the equations, respectively;   and   are the number of measurements for the  th variable and the number of residual points for the  th equation, respectively; and  collects all the unknowns in the system.For the inverse problem presented in section 1.1, we are interested in (1) learning the dynamics of the six states (2) inferring the unknown parameters in the system, given measurements on {  ,   ,   ,  } as well as Eqs.( 3)-( 10), using PINNs.Specifically, we utilize six DNNs as the surrogates for the solutions to different equations, and the corresponding equations are encoded using the automatic differentiation, as illustrated in Table 1.In addition, the loss for training the PINNs for Case 1 to Case 4 is expressed as follows: where θ = (θ 1 , ..., θ 6 ) are the parameters of all NNs in PINNs,  are the unknown parameters, which will be inferred from the given measurements, L  ,  = (   ,   ,   , ũ1 , ũ2 , ũ ,   , 1 ) are the losses for the corresponding equations, and L   ,  = (   ,   ,   ,  ) are the losses for the corresponding measurements, and L   ,  = (   ,   ,   , ũ1 , ũ2 , ũ ,   , 1 ) are the losses for the initial conditions, λ   , λ   , λ   , and λ   are the weights for different loss terms which are used to balance each term in the loss function.In particular, the self-adaptive weight technique proposed in [19], which is capable of tuning the weights automatically, is utilized here to obtain the optimal λ   , λ   , λ   , and λ   .More details for self-adaptive weights in PINN can be found in Appendix A.
In the Case 5 where we have not considered self-adaptive weights, so the loss function is given as As for training the PINNs in the present study, we first employ the first-order optimizer, i.e., Adam [15], to train the parameters in the NNs, unknowns in the systems as well as the self-adaptive weights for a certain number of steps.We then fix the self-adaptive weight and employed Adam to train the parameters in the NNs, and unknowns in the systems for another certain number of steps.We then switch to the second-order accuracy optimizer, i.e., LBFGS-B, to further optimize the parameters in the NNs and the unknowns in the systems.Note that the self-adaptive weights are optimized at the first training stage of Adam only, and they are fixed during the second training stage of Adam and LBFGS-B training with the values at the end of the first stage of Adam optimization.

Neural network surrogates for empirical formulae
In the mean value engine model proposed in [24], empirical formulae, e.g., polynomial functions, are employed for the volumetric efficiency (  ), effective area ratio function for EGR valve (   ), turbine mechanical efficiency (  ), effective area ratio function for VGT (   ), choking function (for VGT) (  Π  ), compressor efficiency (  ), and volumetric flow coefficient (for the compressor) (Φ  ).Note that these empirical formulae are engine-specific and may not be appropriate for the diesel engines considered in the present study.Deep neural networks (DNNs), which are known to be universal approximators of any continuous function, are thus utilized as more general surrogates for the empirical formulae here.Particularly, we employ six DNNs for the aforementioned variables, and the inputs for each DNN are presented in Table 2.We now discuss the training of the DNNs illustrated in Table 2.In laboratory experiments, measurements on all variables are available.We can then train the neural network surrogates in Table 2 using the data collected in the laboratory.The loss function considered for the training of these networks is where  = 1, 2, . . ., 6 are the different neural networks for the approximation of the empirical formulae, x  are the input corresponds to the  th network, ŷ and   are the output of the  th network and the corresponding labelled values respectively,   is the number of labelled dataset corresponds to the  th neural network.The laboratory data required for calculating labelled data for training each of these networks are shown in Table 3 (in §2.3).We discuss the calculation of labelled data from the laboratory data in Appendix D. We train these networks using the Adam optimizer.Upon the training of these DNNs, we will plug them in the PINNs to replace the empirical models, which are represented by the pretrained neural network with the output () in Fig. 2.

Flowchart for PINN model for diesel engine
In section 1.1, we discussed the problem setup, and in subsequent sections, we discussed the approximation of different variables using neural networks as well as the basics of the PINN method and the implementation of PINN in the present problem.In Fig. 2, we have shown a schematic diagram along with a pre-trained network for a general ordinary differential equation.
In this section, we show a complete flowchart for the calculation of physics loss functions for the engine problem.In Fig. 3, we show the flow chart for calculating the physics-informed loss for the present problem.Note that we have not shown the data loss and the self-adaptive weights in the flow chart.Compressor Power Fig. 3: Flow chart for the proposed PINNs model: (Detailed caption is added on the other page).
Detailed Caption for Fig. 3 Fig.3: Flow chart for proposed PINNs model: Flow chart for the proposed PINN model for the inverse problem for the engine for prediction of dynamics of the system variables and estimation of unknown parameters.The inputs are input control vector {  ,   ,   } and engine speed   .
• Four unknown parameters indicated in hexagon are   , ℎ  ,   and   .
• Six pre-trained neural networks N ()  (.; θ),  = 1, 2, . . ., 6 indicated in dashed-dotted rectangular oval takes appropriate input and predict the empirical formulae as shown in Table 2.The parameters (weights and biases) of these pre-trained DNNs are kept fixed to predict the empirical formulae.• Cylinder Temperature: calculates   ,   ,   and   using Eqs.B.14, B.13, B.9 and B. 16 respectively.ℎ   and   are considered as learnable parameters in the calculation of   and   respectively.

Data generation
We now discuss the generation of data for training the NNs utilized in this study.Specifically, we have mainly two different types of data here: (1) the data collected from the laboratory that are used to train the DNN surrogates to replace the empirical formulae used in [24]; and (2) field data   ,   ,   and   .
In laboratory experiments, we have measurements on state variables, some of which can be employed for training the neural network surrogates for the empirical formulae.The laboratory data required to calculate the labelled data for each of the surrogates are shown in Table 3.The calculation of labelled data from laboratory data is discussed in Appendix D. After training, we consider these pre-trained surrogates in field experiments in place of the empirical formulae.The parameters of these networks are kept constant in the PINNs model for the field experiment.
In field experiments, we have records for the four inputs, i.e., u = {  ,   ,   } and   .In addition, we only have measurements on four variables in field experiments, i.e., the intake manifold pressure (  ), exhaust manifold pressure (  ), turbine speed (  ) and EGR mass flow (  ).
In both the laboratory and field experiments, we have the records for the inputs (i.e., u = {  ,   ,   } and   ) from an actual engine running conditions.Considering that we only have a certain number of records for the variables in the running engine, which cannot be used to verify our PINN model since our objective is to use it to predict the whole gas flow dynamics in the engine.We, therefore, take the records for the real inputs (i.e., u = {  ,   ,   } and   ) and employ them as the inputs for the governing equations Eqs.3-8.We then solve these equations using Simulink to obtain the dynamics for all variables.We use the data from Simulink to mimic the real-world measurements, which are employed as the training data for PINNs and the DNN for the pre-trained networks.The remaining data are used as the validation data to test the accuracy of PINN for reconstructing the gas dynamics in a running engine, given partial observations.Given that the real measurements are generally noisy, we add 3%, 3%, 1% and 10% Gaussian noise in   ,   ,   and   , respectively.These different signals have different noise values because they are different measurements with different noise characteristics.
In the present study, we consider two sets of input data in the training and testing of the surrogate neural networks for the empirical formulae.The first set of data (Set-I) is two (2) hours of data collected at a sampling rate of 1 sec.This control input vector {  ,   ,   } and   are considered to generate simulated data with different ambient conditions, which are shown in Table 4.The second set of data (Set-II) is twenty-minute (20 minutes) data collected at a sampling rate of 0.2 sec.This control input vector {  ,   ,   } and   are considered to generate simulated data with Case-V ambient conditions.
The labelled data for the training of surrogate neural network for   ,  ,Π  ,   and Φ  are generated for Case-I to Case-IV with a  = 0.2 sec.The testing data are generated for Case-V with the same .We observed from the engine model that the EGR valve actuator is independent of the other system of the engine and depends only on the EGR control signal (  ).Thus, for the training of surrogate neural network for   (N ()  2 (:, θ)), we consider the training data set corresponding to Case-I only and the testing data set corresponding to Case-V.The labelled data for   are calculated from Eq. (B.25) ( §B.4), which is a differential equation, thus requires a finer .The simulated data for the calculation of labelled   are generated with  = 0.025 sec in all the Cases.We assume that the Set-I data for the input control vector includes a good operating range for training surrogate neural networks for the empirical formulae.The field data (  ,   ,   and   ) for the inverse problem are considered from Case-V.• Intake manifold pressure (  )

Empirical quantities
• Ambient temperature (  ) • Ambient pressure (  ) † It is assumed that the parameters/constant are known, however not the coefficients for the empirical formulae.† † The definition of the quantities are discussed in relevant sections in Appendix B. † † † The calculations of the empirical quantify from the laboratory data are included in Appendix D. † † † † A brief discussion on instrumentation and test procedure is included in Appendix C. † † † † † For calculation of   , dynamic data are required (discussed in Appendix D and section H). (:, θ  )), while Case-V is considered for testing of these networks.The data for the field data are also considered from Case-V.

Results and discussions
In this section, we demonstrate the applicability of proposed PINNs for solving the inverse problems discussed in section 1.1.Case 1 and Case 2 have three unknown parameters, while Case 3 to Case 5 have four unknown parameters.The predicted values of the unknowns for all five cases are shown in Table 5.In this section, we will discuss the results of Case 3 to Case 5.The results of Case 1 and Case 2 are presented in Appendix G.
First, we study the results of Case 3 and Case 5 to understand the applicability of PINN and the importance of self-adaptive weight in accuracy and convergence.Then, we study the results of Case 4, which is similar to Case 3; however, with added noise in the field data considered.We also discuss the results for the surrogate for the empirical formulae in Appendix H.Note that the results for all variables are presented in a normalized scale from zero to one using the following equation, where  and   are the data before and after scaling, respectively,    is the minimum value of true data of  within the time span considered,   is the maximum value of true data of  within the time span considered.We are considering the input control vector {  ,   ,   } and engine speed   from an actual field record.It is assumed that these data have inherent noise in their records.Detailed studies are carried out considering a 1-minute duration.The number of residual points considered in the physics-informed loss and data loss is 301 at equal  = 0.2 sec.The initial conditions considered for {  ,   ,   ,  1 , ũ1 , ũ2 ,   , ũ } are {8.0239× 10 4 , 8.1220 × 10 4 , 0.0505, 305.3786, 18.2518, 18.1813, 1.5827 × 10 3 , 90.0317} respectively.The measured field data are also considered for 1 min with equal  = 0.2 sec.Thus, each of the measured field quantities has 301 records.
The details of the neural networks considered for the PINN problem are shown in Table 6.We consider (.) = tanh(.)activation function for hidden layers for all the neural networks.We would also like to emphasize that the scaling of output is one of the important considerations for faster and an accurate convergence of the neural network.Furthermore, output transformation is another important consideration.The outputs are physical quantity and always positive.The governing equations are valid only for positive quantities (e.g. in Eq.B.20, a negative   will result in negative   ).The output transformation will ensure that the predicted quantities are always positive in each epoch.Similarly, as shown in Table 5, the mask for the unknown parameters will ensure a positive value.We also observed that the unknown parameters are of different scales.The scale considered for the unknown parameters will ensure the optimization of these parameters is on the same scale.The input to the neural networks is time  and the activation functions for the hidden layers are (.)= tanh(.).The outputs for each network are shown in the "Output" column.The "Output transformation" column shows whether the output from the neural network is passed through any other function.The last column, "Scaling", shows the scaling factor to be multiplied by the final output to obtain the variable in physical space.The input to the networks is time 0 to 60 sec and scaled between [−1, 1].

Results for Case 3 and Case 5
We first consider Case 3 and Case 5 in which we have four unknown parameters   ,   , ℎ  and   .The dynamics of   ,   ,   and   can be obtained from the corresponding sensor measurements.We then employ the PINN to predict the dynamics for the variables and infer the four unknowns in the system.The difference between the two cases is that in Case 3, we have considered self-adaptive weights, while in Case 5, we have not considered self-adaptive weights.We consider these two cases to study the applicability of PINN and the importance of self-adaptive weights in the present problem.The predicted output from the neural networks, i.e., the states and  1 and   are shown in Fig. 4. The predicted values of the unknown parameters are shown in Table 5.We observe that the predicted states are in good approximation with the true value in both cases.However, the predicted  1 and   are not in good agreement with the true value.We study the effect of  1 and   on the other variables by comparing the predicted dynamics of   and   (ref Eqs.(B.9) and (B.16)).We also note that   depends on the unknown   and   depends on unknowns   and ℎ  .The predicted dynamics of   and   are shown in Fig. 5.b and 5.c, respectively.We observe that both   and   show somewhat good agreement even  1 and   do not match with the true value.The accuracy is more in Case 3 compared to Case 5. We believe that the difference in the true value and the predicted value is due to the error in the predicted value of unknown parameters.We also study the dependent variables   and   of unknown   and   , and are shown in Fig. 5.a and 5.d, respectively.We observe that in Case 3, the predicted dynamics for both variables show good agreement with true value.However, in Case 5, the   does not show good agreement with true value.This is because the predicted value of   has more error than Case 3.These variables depend on the unknown parameters   ,   , ℎ  and   respectively.We also note that   depends on  1 and   .
In order to study the importance of self-adaptive weights, we study the convergence of the unknown parameters for both cases with self-adaptive weight (Case 3) and without self-adaptive weight (Case 5).The convergences of the unknown parameters with epoch for both cases are shown in Fig. 6.In Case 3 (with self-adaptive weights), we can observe that the unknown parameters converge faster and are more accurate.Furthermore, we also study the effect of different initialization of network parameters for PINN and self-adaptive weights.We run the PINN model for Case 3 and Case 5 with different initialization of parameters of PINN (DNN and unknown parameters) and self-adaptive weight keeping other hyperparameters (number of epoch considered, learning rate scheduler etc.) the same.The results for both cases are shown in Fig. 7.It is observed that for unknowns,   and   for both cases show similar accuracy.However, for unknowns,   and ℎ  , Case 3, which is with self-adaptive weights, shows better accuracy than Case 5 (without self-adaptive weights) for all the runs.In Fig. 8, we show the self-adaptive weights for   ,   ,   and   after 100 × 10 3 epoch (constant value after 100 × 10 3 epoch).Thus, we conclude that self-adaptive weights are important for better accuracy and convergence for the present problem.

Results for Case 4: Four unknowns with noisy measurement data
In the previous section, we have shown the effectiveness of PINN and the importance of selfadaptive weights.In this section, we test the robustness of the proposed PINN formulation for predicting the gas flow dynamics of the diesel engine given noisy data.In particular, we are considering Case 4 (the same Case 3 but noisy measure data), in which we have four unknown parameters   ,   , ℎ  and   , with noise measurement of   ,   ,   ,   .We contaminate the training data   ,   ,   ,   considered in Case 3 with Gaussian noise and consider these as synthetic field measurements.We present the predicted dynamics of the known data in Fig. 9(a)-(d) and unknown parameters in Table 5.We observe that the dynamics of the predicted   ,   ,   ,   matches with the reference solution.However, in the case of   , there is a small discrepancy in the predicted values near 20-25 sec, which we can attribute to over-fitting caused by the noisy training data.We study the dynamics of   ,     and   on which we do not have any measured data, and these are shown in Fig. 9(e)-(h).We observe that   matches with the reference results.Most of the dynamics of   and   match with the reference solution.The mismatch in these two variables may also be attributed to over-fitting caused by noisy data.The profile of   matches with the reference solution, however, it is not an exact match with the reference solution.This is because of the error in the predicted value of unknown parameter   and ℎ  .We also note that in the present study, we do not have any temperature measurements of field data.Thus, we expect an error in the predicted temperature measurement.We also study the convergence of the unknown parameters with epoch and shown in Fig. 10.We note that, in this case, we consider the same hyperparameters in the optimization process.In some cases, we see over-feeting due to noisy data.This may be controlled by changing the hyperparameters, specially the learning rate for the self-adaptive weights.We also study the prediction of empirical formulae in this case and shown in Fig. 11.We observe that   and   match with the reference solution.These two quantity gives the volumetric efficiency of the cylinder and the efficiency of the compressor.The other four quantities (   ,   ×  Π  ,   , Φ  ), also match most of its points.The discrepancy can be attributed to the noisy measurement of field data.

Summary
In this study, we proposed a PINNs-based method for estimating unknown parameters and predicting the dynamics of variables of a mean value diesel engine with VGT and EGR, given the measurement of a few of its variables.Specifically, we know field data of intake manifold pressure (  ), exhaust manifold pressure (  ), turbine speed (  ) and EGR flow (  ).We predicted the dynamics of the system variables and unknown parameters (  ,   , ℎ  and   ).The input data for the study are considered from actual engine running conditions and show good accuracy in predicted results.We also studied the importance of self-adaptive weight in the accuracy and convergence of results.Furthermore, we also showed how we could approximate empirical formulas for different quantities using neural networks and train them.We believe the proposed method could be considered for an online monitoring system of diesel engines.The field-measured data are collected using individual sensors.Thus, in the event of sensor failure or erroneous data, the method may give erroneous results.The method also does not consider a failure of engine components, e.g.leakage in the EGR valve.We considered the engine model proposed in [24].Future research may include modelling of failure of engine components.Since the proposed PINN consider online training, with change in input data, field measured data or ambient condition, the PINN networks are required to train again.The accuracy of the results also depends on the size of neural networks and the optimization strategy (e.g.optimizer, learning rate scheduler) considered.For example, a large neural network or higher value in learning rate may result in overfitting of predicted results.The activation function also plays an important role in the accuracy and computational cost [11].Further study may include a neural architecture search for optimal network sizes considering different operational ranges.Future studies may include a more robust and efficient PINN method for the problem that can be used with edge systems, including proper transfer learning strategies to reduce the computation cost.As there is noise in the measured data, the future study in this regard may also be towards uncertainty quantification of the predicted dynamics and unknown parameters.

Input data and data generations
The input data Set-I and Set-II are collected from actual engine running conditions.These data are considered to generate simulated data with different ambient conditions using the Simulink file [22] accompany [24].
adaptive wights [19] for the loss function.The loss function is maximized with respect to the self self adaptive weights ().Thus, the optimization process may be written as, Consider the updates of a gradient descent/ascent approach to this problem where,   and   are the learning rate associated with θ and λ.
In the present study, the parameters are optimized using Adam and L-BFGS-B optimizer in Tensorflow-1 (with single precision floating point).Further, self-adaptive weights are optimized only during the process of Adam optimization up to fixed epoch as discussed in section 3

Appendix B Engine model
As discussed in section 1.1, we consider a mean value engine model proposed by Wahlström and Eriksson [24] in our present study.The engine has eight states, and we have considered six in the present study.These are, where   and   are the intake and exhaust manifold pressure, respectively,   is the turbo speed.ũ1 and ũ2 are the two states for the EGR actuator dynamics, and ũ represents the VGT actuator dynamics.The control inputs for the engine are u = {  ,   ,   } and the engine speed is   .Where   is the mass of injected fuel,   and   are the EGR and VGT valve positions, respectively.The mean value engine model is then expressed as 2) The engine model consists of 6 parts intake and exhaust manifold, the cylinder, the turbine, EGR valve system, and the compressor system.A schematic diagram of the engine is shown in Fig. 1.In this section, we briefly discuss the equation required for the present study and these are taken from [24].For detail of the engine model, the interested reader may refer to Wahlström and Eriksson [24].

B.1 Manifold pressures
The pressure at the intake manifold (  ) is modelled using a first-order differential equation as, where   and   are the temperature and volume of the intake manifold, respectively, and both are assumed to be constant,   ,   and   are the compressor mass flow, EGR mass flow and total mass flow, respectively.The ideal gas constant and specific heat capacity of the air are   and   , respectively.Similarly, the exhaust manifold pressure   is modelled as, where   is the ideal gas constant of the exhaust gas with specific heat capacity   ,   and   are the exhaust manifold temperature, and volume,   ,   are the mass flow out from the cylinder and turbine mass flow, respectively.

B.2 Cylinder
The total mass flow from the intake manifold to the cylinder   , and the total mass flow out of the cylinder   are modelled as, The residual gas fraction (  ) is model as The pressure ratio (  ) and the volume ratio (  ) in the Seliger cycle between point 3 (after combustion) and point 2 (before combustion) are modelled as, 13) where the specific energy constant of the charge is modelled as The temperature at cylinder out modelled in Eq. (B.9) is the temperature at the cylinder exit.However, it is not the same as the temperature as the exhaust manifold.This is due to the heat loss in the exhaust pipes between the cylinder and the exhaust manifold.The exhaust manifold temperature (  ) is given as where   is the ambient temperature,    ,    and    are the pipe diameter, pipe length and the number of pipes, respectively.

B.3 EGR valve
The actuator dynamics of the EGR-valve are modelled as, where  1 ,  2 are time constants,   is the time delay and   is a constant that affect the overshoot.We model the mass flow through the EGR valve through the restriction (  <   ) as, where Ψ  is a parabolic function The effective area is modelled as, When the sonic conditions are reached (flow is choked) in the throat and when no backflow can occur (1 <   /  ), the pressure ratio Π  over the valve is limited and modelled as, , Π   are constant and   ( ũ ) is modelled as a polynomial function, where  1 ,  2 and  3 are constant.

B.4 Turbocharger
The turbo speed,   is modelled as a first-order differential model as, where   is the inertia,   and   are the power delivered by the turbine and power required to drive the compressor, respectively,   is the mechanical efficiency of the turbocharger.The VGT actuator system is modelled as a first-order system where   and   are the time constant and time delay respectively.The turbine mass flow (  ) is calculated using is the maximum area in the turbine that the gas flow through.
where   a constant and Π  =   /  .  >   if there is a restriction like an after-treatment system.However, in the model we consider, there is no restriction after the turbine, thus Further, with the increase in VGT control signal (  ), the effective area increases and thus also increases the flow.The effective area of the VGT   ( ũ ) is modelled as an ellipse The power delivered by the turbine,   and the mechanical efficiency of the turbocharger   are modelled as, where, the blade speed ratio (BSR) is defined as the ratio of the turbine blade tip speed to the speed which a gas reaches when expanded entropically at the given pressure ratio Π  .
where   is the turbine blade radius, and

B.5 Compressor
The compressor model consists of two models: the compressor efficiency model and the compressor mass flow model.The compressor efficiency is defined as the ratio of the power from the isentropic process ( , ) to the compressor power (  ) where   is the temperature after the compressor, and the pressure ratio is given by, The power from the isentropic process is given as,  , =       (Π The model for compressor mass flow,   is modelled using two non-dimensional variables: energy transfer coefficient (Ψ  ) and volumetric flow coefficient (Φ  ).The energy transfer coefficient is defined as,

Appendix D Calculation of labelled data for training of the neural network for the empirical formulae
We approximate the empirical formula using surrogate neural networks and are discussed in section 2.1.1.The lab test data required for calculating each of these quantities are shown in Table 3.In this section, we discuss the calculation of labelled data from lab-test data.The functional approximation of the empirical formulae is independent of time; thus, static data may be considered for the calculation of labelled data.However, in the case of calculation of labelled for   , the differential equation Eq. (B.25) is considered.Thus, we consider dynamic data for this calculation.We approximate the volumetric efficiency using a surrogate neural network (N () 1 (:, θ  1 ).The inputs to the network are intake manifold pressure (  ) and engine speed (  ) and trained using labelled data of   .The labelled   are calculated from measurement of   using Eq.It is important to node that the value of Ψ  varies from 0 to 1 (Eq.(B.21)), thus in the calculation of   , a situation may occurs where division by 0. This situation occurs when   <   (Eq.(B.23)).In order to avoid this, labelled data are calculated only for Ψ  > 10 −15 .
The neural network approximating (N () 3 (:, θ  3 ) for  ,Π =   ×  Π  is trained using labelled data which are calculated from the measurement of turbine mass flow (  ) using Eq.In the present study, we consider a five-point method to approximate the derivative present in Eq. (D.5). (1)

Appendix E Detail loss function for the PINNs model for the engine
We consider the following loss function for Case 1 to Case

1 Fig. 2 :
Fig. 2: Schematic of physics-informed neural networks (PINNs) for inverse problems: The left part of the figure, enclosed in the red dashed line, shows a DNN whose input is time.The DNN is to approximate the solution () to a differential equation.The top left part of the figure enclosed in the black dashed line shows an DNN whose input is the output  (maybe with other input, e.g.ambient condition).The output of this network is a function ().This network is pre-trained with laboratory data of  and ().The right part of the figure, enclosed in the blue dashed line, denotes the physics loss/residue.The DNN (enclosed in a red dashed line) approximates the solution to any differential equation, and the equation is encoded using automatic differentiation.The total loss L (θ) includes the loss of equation as well as the data.The  1 and  2 are two weights to the data loss and physics loss, which may be fixed or adaptive depending upon the problem and solution method.θ = {W , b, Λ} represents the parameters in DNN, W and b are the weights and biases of DNN, respectively and Λ are the unknown parameters of the ODE;  is the activation function, () is the right-hand side (RHS) of the differential equation (source term), ℎ is the function of the predicted variable, and  is the residual for the equation.θ  = {W  , b  } represents the parameters in pre-trained neural network, W  and b  are the weights and biases of the pre-trained neural network.
There are eight main blocks calculating different variables.The equations for the calculation of each of the quantities are shown in Appendix B. • Cylinder flow: calculates   ,   and   using Eqs.B.5, B.7 and B.6 respectively.

Fig. 4 :Fig. 5 : 5 :
Fig. 4: Predicted states and  1 and   for Case 3 and Case 5: Predicted dynamics of the state variables of the engine and   and  1 for Case 3 (PINN with self-adaptive weights)and Case 5 (standard PINN without self-adaptive weights).The variables are scaled using Eq.16.It can be observed that the predicted dynamics of the states are in good agreement with the true values.However,  1 and   do not match with the true value.We study the dependent variables of these two variables, and are shown in Fig.5.

Fig. 6 : 5 :
Fig. 6: Convergence of the unknown parameters for Case 3 and Case 5: Convergence of the unknown parameters with epoch for Case 3 (PINN with self-adaptive weights) and Case 5 (standard PINN without self-adaptive weights).It is observed that Case 3 converges faster and also shows better accuracy.

Fig. 7 :
A vgtmax Black dashed line → true value, Blue dots → Case 3, Red dots → Case 5 Predicted unknown parameters for Case 3 and Case 5: Predicted unknown parameters for Case 3 (PINN with self-adaptive weights) and Case 5 (standard PINN) when prediction is made multiple times with different initialisation of the parameters of PINN, self-adaptive weights, and the unknown parameters.

Fig. 8 :
Fig. 8: Self-adaptive weights for Case 3: Self-adaptive wights for   ,   ,   and   after 100 × 10 3 epoch of Adam optimization.The values of the self-adaptive weights after 100 × 10 3 Adam optimization and LBFGS-B optimization are constant with the values of self-adaptive weight at 100 × 10 3 epoch.

Fig. 9 :
Fig. 9: Predicted dynamics for variables for Case 4: Predicted dynamics of (a)-(d) variables whose noisy field measurements are known.(e)-(h) dynamics of other important variables, which are also dependent on the unknown parameters.These results are for Case 4 with 4 unknown parameters and noisy field measurements.

Fig. 10 : 4 :
Fig. 10: Convergence of the unknown parameters for Case 4: Convergence of the unknown parameters with epoch for Case 4 (PINN with self-adaptive weights and noisy field data)

Fig. 11 :
Fig. 11: Empirical formulae for Case 4: The prediction of empirical formulae for Case 4(PINN with self-adaptive weights and noisy field data).

Case 1
Prediction of dynamics of the system and identification of 3 unknown parameters   ,   and ℎ  with clean data of   ,   ,   , and   .Prediction of dynamics of the system and identification of 3 unknown parameters   ,   and ℎ  with noisy data of   ,   ,   , and   .Prediction of dynamics of the system and identification of 4 unknown parameters   ,   , ℎ  and   with clean data of   ,   ,   , and   .Prediction of dynamics of the system and identification of 4 unknown parameters   ,   , ℎ  and   with noisy data of   ,   ,   , and   .

Table 1 :
Neural network surrogates employed PINNs for solving the inverse problems.

Table 2 :
Neural network surrogates for empirical formulae N ()   ),  = 1, . . ., 6 denotes the surrogate for the  ℎ DNN parameterized by    with the input x.All the neural networks have one output each.

Turbine Power: calculates
effective turbine power     using Eq.B.32 There are five blocks, which calculate the residual of the equation.The first block calculates the residual for state equations for   and   ; the second one calculates the residual for the equations of   and  1 ; the third block calculates the residuals for state equations for ũ1 and ũ2 ; the fourth block calculates the residual for the state equation for ũ , and the fifth block calculates the residual for the state equation for   .There are another two blocks, which calculate the physics loss.The first one calculates the physics loss corresponding to state variable   ,   and   .The second block calculates state physics loss corresponding to state variables ũ1 , ũ2 , ũ and physics loss corresponding to   and  1 .The data losses can be calculated from the variables calculated from the appropriate blocks.

Table 3 :
List of empirical formulae represented using a pre-trained neural network and lab test data required for their training † .

Table 4 : Ambient conditions for training and testing of neural networks:
The different ambient conditions are considered for generating training and testing data.The input data Set-I is two hours of input control vector {  ,   ,   } and   collected from an actual engine running condition.Similarly, Set-II is twenty-minute of input control vector {  ,   ,   } and   collected from an actual engine running condition.Case-I to Case-IV are considered for the training of the surrogate neural network for the empirical formulae (N()

Table 6 :
The parameters of the neural network are optimized first using Adam optimized in Tensorflow-1 with 200 × 10 3 epoch and further with LBFGS-B optimized.It is also important to note that we have considered self-adaptive weights in the proposed method; thus, we considered different optimizers for each set of self-adaptive weights.Further, self-adaptive weights are optimized only during the process of Adam optimization up to 100 × 10 3 epoch.After 100 × 10 3 epoch and during the process of optimization using LBFGS-B, the self-adaptive weights are considered constants with the values at 100 × 10 3 epoch of Adam optimization.The sizes of self-adaptive weight are 301 × 1 for λ   , λ   , λ   and λ   .The size of self adaptive weight of λ  1 is 1 × 1. Softplus masks are considered for all the self-adaptive weights.Details of neural network for PINNs: Details of neural networks considered to approximate the state variables and  1 and   .
,   and   are the displaced volume, engine speed and the number of cylinders, respectively.The volumetric efficiency,   of the cylinder may be modelled as  2 and  3 are constant.The temperature at cylinder out based upon ideal-gas Seliger cycle (or limited pressure cycle) and given as,   =   Π   ,   and   are compensation factor for non-ideal cycles and compression ratio.The temperature,  1 when the inlet valve closes and after the intake stroke and mixing is given by,  1 =     + (1 −   )  (B.11) is modelled as an ellipses, which depends on the pressure ratio (Π  ) and compressor mass flow (  ),   =   − X  Q  X    and    are the optimum values of   and   respectively.  is a non linear transformation of Π  as = (Π  − 1)   (B.42)and Q  is a semi-definite matrix ) and volumetric flow coefficient (Φ  ) can be described by a part of an ellipse, Ψ1 (  )(Ψ  −  Ψ2 ) 2 +  Φ1 (  )(Φ  −  Φ2 ) 2 = 1 (B.46)whereΨ1 and  Φ1 are function of turbine speed (  ) and modelled as a second order polynomial as, Ψ1 (  ) =   Ψ1  2  +   Ψ2   +   Ψ3 (B.47)  Φ1 (  ) =   Φ1 2  +   Φ2   +   Φ3 (B.48) Solving Eq.B.46 for Φ  and Eq.B.45 for   , the compressor mass flow is given as,  1 (Ψ  −  Ψ2 ) 2   Ψ2 ,   Ψ3 ,   Φ1 ,   Φ2 ,   Φ3 ,  Φ2 and  Ψ2 are constant.steadystate characterizations are used to obtain a static characterization.Consider volumetric efficiency as an example: because measuring flow directly into or out of the cylinder is difficult, a fresh air flow measurement combined with an EGR flow measurement can be used to estimate charge flow to enable the calculation of volumetric efficiency.However, any intake, EGR, or Exhaust leak impacts this measurement, as does the tolerance stack up of both measurements.