Development of Engine E ﬃ ciency Characteristic in Dynamic Working States

: The objective of this paper is to present a new approach to the problem of combustion engine e ﬃ ciency characteristic development in dynamic working states. The artiﬁcial neural network (ANN) method was used to build a mathematical model of the engine comprising the following parameters: Engine speed, angular acceleration, engine torque, torque change intensity, and fuel mass ﬂow, measured on a test bed on a spark ignition engine in static and dynamic working states. A detailed analysis of ANN design, data preparation, the training method, and the ANN model accuracy are described. The paper presents conducted calculations that clearly show the suitability of the approach in every aspect. Then, a simpliﬁed ANN was created, which allows a two dimensional characteristic in dynamic states, including 4 variables, to be determined.


Introduction
The overall efficiency of the internal combustion engine is one of its most important operational parameters. It directly influences fuel consumption, which is an extremely important factor both for drivers and car manufacturers who have to meet the strict EU regulations [1].
The overall engine efficiency is defined as the quotient of the mechanical power on the flywheel to the power of the fuel injected into the cylinders. It takes into account all losses related to both thermodynamic processes, internal friction mainly among moving parts in the crank and piston system, as well as losses in the alternator drive, the coolant pump, and other accessories.
Currently, the efficiency of internal combustion engines is up to 40% for spark ignition (SI) naturally aspirated engines [2] and up to 36% for SI turbocharged engines [3]. Over the last 20 years, efficiency has grown by about 10%, due to numerous factors. The main ones are as follows: The use of fuel injection systems, modern lubricants, coatings on pistons and cylinders [4], optimization of the valve timing [5], the use of the Atkinson cycle [2], improved fuels, increased compression ratio and many others.
A well-known method for presenting the efficiency of engines is with the specific fuel consumption, which has been used for many years [6]. It represents isolines of specific fuel consumption as a function of engine rotational speed and torque. It illustrates the efficiency of the engine in the whole working range and makes it possible to compare different constructions. An important limitation of this characteristic is the possibility of applying it only to steady states of engine operation, where the rotational speed and torque are constant and the throttle position is fixed. Therefore, its use in simulations of vehicle fuel consumption is dedicated to significant errors, because vehicle engines work dominantly in dynamic working states [7], where energy accumulation in rotating masses, mixture enrichment at throttle opening, and fuel cut off during deceleration significantly influence engine efficiency. Despite this big disadvantage, this characteristic is often used in simulations of vehicle fuel consumption in different driving cycles. However, it can only be used with sufficient accuracy rotational speed n, the contours of specific fuel consumption are presented. Such a characteristic is 104 presented in Figure 1.

107
The graph in Figure 1 is created based on a method presented in Reference [8], where the 108 algorithm of drawing such a characteristic, based on only 4 operating points, is described in detail.

109
This characteristic can be directly converted to a characteristic of engine efficiency: where N is the engine power in kW, G is fuel mass flow in g/s, and Wd is the heat value of the fuel in 111 MJ/kg.

112
As mentioned in the Introduction, these characteristics are based on measurements in static

119
It is therefore important to determine the characteristics that, as well as the engine speed n and 120 torque M, also take into account the angular acceleration and the increase in the torque over time,

121
which significantly affect efficiency, as shown in Figure 3.  The graph in Figure 1 is created based on a method presented in Reference [8], where the algorithm of drawing such a characteristic, based on only 4 operating points, is described in detail. This characteristic can be directly converted to a characteristic of engine efficiency: where N is the engine power in kW, G is fuel mass flow in g/s, and W d is the heat value of the fuel in MJ/kg. As mentioned in the Introduction, these characteristics are based on measurements in static states. In dynamic states, the efficiency of the engine can vary significantly. This results from the following factors: Enrichment of the mixture during load increase (in relation to static states), delay of the system response to the control signal, and accumulation of combustion energy in moving parts of the engine ( Figure 2). Although this energy can be partially recovered during deceleration with engine braking, it is usually lost in the form of pumping losses when the throttle is closed and the engine speed is reduced.
It is therefore important to determine the characteristics that, as well as the engine speed n and torque M, also take into account the angular acceleration and the increase in the torque over time, which significantly affect efficiency, as shown in Figure 3.
Such an attempt is strongly desired, because car engines work for a predominant percentage of time in dynamic working conditions, which results from the specificity of road traffic, especially in the area of large urban agglomerations, the impact of road resistance, wind resistance, or the driver's own operation of the vehicle. It turns out that, in such working conditions, the efficiency of the engine is even smaller. In the WLTP homologation test (Worldwide harmonized light duty vehicle test procedure), the phases in which the engine operates with a constant load are only under 17% of the entire test time. This clearly shows that the use of fuel consumption characteristics in dynamic work states is insufficiently accurate. dual mass fly-wheel, 9 -  measurement data from the engine test bench, which allows measurements of the fuel consumption 141 in dynamic operating states to be performed. This is necessary to ensure an appropriate training set 142 for the ANN. Such a set must contain measurement data from all the possible operating states of the 143 engine, covering the entire engine work field, in this case n = 1000-5500 rpm and M = 0-65 Nm. The 144 measurement methodology is described in detail in Reference [7]. Measurements were performed on 145 an SI engine with a displacement of 899 cm 3 , a nominal power of 29 kW at 5500 rpm, and a nominal 146 torque of 65 Nm at 3000 rpm. Resistant torque was generated by a hydraulically controlled friction 147 brake enabling smooth and rapid load changes ( Figure 4). Two parameters, the brake load and

Measurements in Dynamic Working States
The presented engine efficiency characteristic, using the ANN, is determined based on measurement data from the engine test bench, which allows measurements of the fuel consumption in dynamic operating states to be performed. This is necessary to ensure an appropriate training set for the ANN. Such a set must contain measurement data from all the possible operating states of the engine, covering the entire engine work field, in this case n = 1000-5500 rpm and M = 0-65 Nm. The measurement methodology is described in detail in Reference [7]. Measurements were performed on an SI engine with a displacement of 899 cm 3 , a nominal power of 29 kW at 5500 rpm, and a nominal torque of 65 Nm at 3000 rpm. Resistant torque was generated by a hydraulically controlled friction brake enabling smooth and rapid load changes ( Figure 4). Two parameters, the brake load and throttle opening angle (in the full range 0-90 • ), were controlled so all the engine working states could be realized. Measurements were performed at a nominal engine temperature. No warm-up period was included. The engine speed was measured with the use of a Tacho GT 3.10 L/405 tachometer. To match the measurement range of the data acquisition device (0-10 V), an additional tooth belt drive, with a ratio of 2.909, was used. The fuel flow was measured indirectly. A Bosch 0 280 217 123 air mass flow meter measured the airflow and an LSU-4.1 Innovate Motorsport LC-1 wideband oxygen sensor (measurement range of λ = 0.5 ÷ 1.523), with a controller, constantly measured the air-fuel ratio. The brake caliper was pivoted and the reaction force was generated by a compression spring, whose shortening was measured by a potentiometer, and a lever system. Such a system measured the moment of resistance, taking into account both the contact pressure between the pads and the disc, as well as the friction coefficient between these elements. The moment of inertia of all elements is known and is taken into account at the stage of building the training set for the ANN. All 4 sensors generated analog voltage signals and were connected to a National Instruments NI USB-6009 data acquisition device. LabVIEW software was used to collect the data on the computer.

168
All the possible engine states that might occur during normal engine operation in a vehicle 169 must be performed during measurements. All of them are presented in Figure 5.     All the possible engine states that might occur during normal engine operation in a vehicle must be performed during measurements. All of them are presented in Figure 5. measured the air-fuel ratio. The brake caliper was pivoted and the reaction force was generated by a 156 compression spring, whose shortening was measured by a potentiometer, and a lever system. Such a 157 system measured the moment of resistance, taking into account both the contact pressure between 158 the pads and the disc, as well as the friction coefficient between these elements. The moment of 159 inertia of all elements is known and is taken into account at the stage of building the training set for       Figure 5 represents all the situations that might occur during driving. The first one is driving at constant speed on a flat road, the second one is sudden throttle opening-a demand for acceleration, the third one is acceleration with constant torque, the fourth case is engine braking, and the fifth one is slow acceleration with torque and speed increase.

Data Analysis with the Use of ANN
To use the ANN for measurement data approximation, the ANN architecture, data scaling, transfer functions, and training methods must be defined. The aim is to calculate engine efficiency (resulting from fuel mass flow), which is a function of 4 parameters, as follows: Engine speed n, torque M and angular acceleration ε n , and torque increase over time ε M . Thus, the considered ANN must have 4 inputs and one output. Only one hidden layer can be used because, with a proper number of hidden neurons, such a network is capable of approximating non-linear relationships with high accuracy [19]. The non-linear function in the hidden layer was set to logsig, which is one of the transfer functions available. It ensures similar results to other functions (e.g., tansig), however, it can be calculated quickly, thus accelerating calculations [19]. Data scaling for all inputs and the output is proportional, because an increase of every single input results in an increase of the output. The ANN used for calculations is presented in Figure 6. can be calculated quickly, thus accelerating calculations [19]. Data scaling for all inputs and the 186 output is proportional, because an increase of every single input results in an increase of the output.

187
The ANN used for calculations is presented in Figure 6.  The number of hidden neurons depends on many factors, e.g., the data number (in this case, the training set contained nearly 13,800 data parts from measurements in dynamic and static states), the homogeneity of measurement data, and the method of data scaling, and thus cannot be set up front. The author verified mean squared error (mse) for subsequent numbers of hidden neurons, as presented in Figure 7.
Energies 2019, 12, x FOR PEER REVIEW 6 of 13 must have 4 inputs and one output. Only one hidden layer can be used because, with a proper number of hidden neurons, such a network is capable of approximating non-linear relationships with high accuracy [19]. The non-linear function in the hidden layer was set to logsig, which is one of the transfer functions available. It ensures similar results to other functions (e.g., tansig), however, it can be calculated quickly, thus accelerating calculations [19]. Data scaling for all inputs and the output is proportional, because an increase of every single input results in an increase of the output. The ANN used for calculations is presented in Figure 6. The number of hidden neurons depends on many factors, e.g., the data number (in this case, the training set contained nearly 13,800 data parts from measurements in dynamic and static states), the homogeneity of measurement data, and the method of data scaling, and thus cannot be set up front. The author verified mean squared error (mse) for subsequent numbers of hidden neurons, as presented in Figure 7. The mse decreases with increasing numbers of hidden neurons H, however, the higher the H the higher the possibility of data overfitting (mse < 0.00200), resulting in discontinuities on the graph (Figure 7), which are created based on the ANN. Taking these two factors into consideration, it turned out that H = 5 is optimal, because it ensures high accuracy and does not lead to data overfitting.
The ANN approximates measurement data, thus setting the dependency between engine speed torque and fuel mass flow. The input data vector X 0 are engine parameters given in their basic units, as follows: Engine speed n in rpm, engine angular acceleration ɛn rpm/s, engine torque M in Nm, engine torque increase ɛM in Nm/s, and the fuel flow G in g/s. The parameters ɛn and ɛM are considered in the time interval 0.3 s [7]. The input vector, The mse decreases with increasing numbers of hidden neurons H, however, the higher the H the higher the possibility of data overfitting (mse < 0.00200), resulting in discontinuities on the graph (Figure 7), which are created based on the ANN. Taking these two factors into consideration, it turned out that H = 5 is optimal, because it ensures high accuracy and does not lead to data overfitting.
The ANN approximates measurement data, thus setting the dependency between engine speed torque and fuel mass flow. The input data vector X 0 are engine parameters given in their basic units, as follows: Engine speed n in rpm, engine angular acceleration ε n rpm/s, engine torque M in Nm, engine torque increase ε M in Nm/s, and the fuel flow G in g/s. The parameters ε n and ε M are considered in the time interval 0.3 s [7]. The input vector, must be scaled to the range (−1; 1) resulting in the vector X 1 : To ensure proper ANN training, data scaling is conducted according to the following formulas (with regard to Figure 6): The ANN output Y 0 , which is the fuel mass flow G.
was also scaled to the range (−1; 1) according to the following formula: The hidden layer weights matrix is: and hidden layer biases are: where h (h = 1 . . . H) is the number of a hidden neuron, and in is the number of the input (in = 1 . . . IN = 4). In a summing member, the input, multiplied by its weights, is summed with bias: The sum p h 1 is then calculated with the use of the non-linear logsig transfer function f 1 : and multiplied by the output layer weights: The sum of p 1 2 is converted with the use of the simple linear transfer function f 2 : The output layer bias matrix is: The whole training set was divided as follows: 60% training set, 20% validation set, and 20% test set. The ANN was trained with the Lavenberg-Marquardt algorithm [19,20]. The training process took 49 epochs, which resulted in the mean squared error of 0.00224. Its graph during the learning process is presented in Figure 8. Achieving the expected value of mse is equivalent to the completion of the ANN training. The matrices W 1 , b 1 , W 2 , b 2 , which represent the result of the network learning and represent the ANN engine dynamic model, are the following: After ANN training, engine torque is re-scaled from the (−1; 1) range to the basic range (0.1897 ÷ 2.979 g/s), based on the following relationship: By simulation of such an ANN, a static efficiency characteristic can be obtained. It is shown in Figure 9.  Achieving the expected value of mse is equivalent to the completion of the ANN training. The matrices W 1 , b 1 , W 2 , b 2 , which represent the result of the network learning and represent the ANN engine dynamic model, are the following: After ANN training, engine torque is re-scaled from the (−1; 1) range to the basic range (0.1897 ÷ 2.979 g/s), based on the following relationship: By simulation of such an ANN, a static efficiency characteristic can be obtained. It is shown in Figure 9. 2.979 g/s), based on the following relationship: By simulation of such an ANN, a static efficiency characteristic can be obtained. It is shown in Figure 9.  The characteristic, which is entangled in weights, biases (Equations (14)- (17)), transfer functions (Equations (10) and (12)), and scaling factors (Equation (4) and (6)), can be used in different simulations for precise calculations of engine efficiency. However, the engine efficiency cannot be assessed in a straightforward manner, as in the case of graphic representation. As a consequence of this, the author's method for graphical representation of such a characteristic is presented in the next chapter.

Development of the Graphic Engine Efficiency Characteristic
The ANN presented in Section 3 can be used in computer simulations, because it ensures high accuracy. However, it does not allow a simple 2D or 3D characteristic to be obtained. Thus, a modified ANN, with a new architecture, will be used in this chapter to develop such a characteristic. First of all, an ANN with only one hidden neuron will be used. Secondly, it will differ from the previous one, because, in this case, engine efficiency is directly the ANN output. The logsig shape of the transfer function f 1 will be the base for the characteristic. All of the 4 variables must be presented simultaneously, because they influence each other. The architecture used is presented in Figure 10. The characteristic, which is entangled in weights, biases (Equations (14)- (17)), transfer functions (Equations (10) and (12)), and scaling factors (Equation (4) and (6)), can be used in different simulations for precise calculations of engine efficiency. However, the engine efficiency cannot be assessed in a straightforward manner, as in the case of graphic representation. As a consequence of this, the author's method for graphical representation of such a characteristic is presented in the next chapter.

Development of the Graphic Engine Efficiency Characteristic
The ANN presented in Section 3 can be used in computer simulations, because it ensures high accuracy. However, it does not allow a simple 2D or 3D characteristic to be obtained. Thus, a modified ANN, with a new architecture, will be used in this chapter to develop such a characteristic. First of all, an ANN with only one hidden neuron will be used. Secondly, it will differ from the previous one, because, in this case, engine efficiency is directly the ANN output. The logsig shape of the transfer function f 1 will be the base for the characteristic. All of the 4 variables must be presented simultaneously, because they influence each other. The architecture used is presented in Figure 10. The fact that the output is engine efficiency means that the 2 nd and 4 th inputs must be scaled inversely proportionally (different than in the first ANN with 5 hidden neurons (Figure 6)), because both high angular acceleration and increased torque reduce engine efficiency. The input values remain the same: They are scaled to the range (−1; 1), thus creating the vector X 1 : The fact that the output is engine efficiency means that the 2nd and 4th inputs must be scaled inversely proportionally (different than in the first ANN with 5 hidden neurons (Figure 6)), because both high angular acceleration and increased torque reduce engine efficiency. The input values remain the same: They are scaled to the range (−1; 1), thus creating the vector X 1 : Data scaling is the following: The ANN output Y 0 is the engine efficiency η [%]: It was also scaled to the range (−1; 1), according to the following formula: The training process took 18 epochs this time, which resulted in the mean squared error of 0.00854. Its graph during the learning process is presented in Figure 11.
The training process took 18 epochs this time, which resulted in the mean squared error of 0.00854. Its graph during the learning process is presented in Figure 11.
After ANN training, engine torque is re-scaled from the (−1; 1) range to the basic range (0-33%) based on the following relationship: Then, it must be verified if only one hidden neuron is capable of approximating the whole data set, because it is essential to create a characteristic with reasonable accuracy. Based on the two neural networks above, static characteristics are created. The result obtained with the use of the ANN with After ANN training, engine torque is re-scaled from the (−1; 1) range to the basic range (0-33%) based on the following relationship: Then, it must be verified if only one hidden neuron is capable of approximating the whole data set, because it is essential to create a characteristic with reasonable accuracy. Based on the two neural networks above, static characteristics are created. The result obtained with the use of the ANN with one hidden neuron differs no more than 5% for 95% of the engine working field from the ANN with 5 neurons. Thus, the accuracy is reasonable and the ANN with 1 neuron can be used further for 2D characteristic development.
To obtain a simple and direct relationship between the engine parameters and its efficiency scaling coefficients (Equation (21)), its input weights are multiplied and simplified, according to the following equations: After transformation: The final coefficients are the following: Taking into account (Equation (2)), this results in the final dependency, which can be directly moved further on the graph: Finally, the logsig function is converted by the output layer weight W 2 , and then by rescaling the output data. This is presented in Figure 12. Taking into account (Equation (2)), this results in the final dependency, which can be directly moved further on the graph: Finally, the logsig function is converted by the output layer weight W 2 , and then by rescaling the output data. This is presented in Figure 12. To create a graphic representation, the coefficients are scaled to specific lengths in a graph. This allows a simple and quick assessment of engine efficiency. The final characteristic is presented in Figure 13. To create a graphic representation, the coefficients are scaled to specific lengths in a graph. This allows a simple and quick assessment of engine efficiency. The final characteristic is presented in Figure 13.  To create a graphic representation, the coefficients are scaled to specific lengths in a graph. This allows a simple and quick assessment of engine efficiency. The final characteristic is presented in Figure 13. This characteristic allows a simple assessment of engine efficiency in the whole working range. The length of the measurement sections clearly shows the influence of individual components on the overall efficiency of the engine and, in particular, how it decreases where angular acceleration or torque increase occur. The main advantage of the characteristic is that it is a continuous and differentiable function, which allows the efficiency to be calculated at any working point.

Simulation Results and Comparison of Dynamic and Static Characteristic
The ANN network with 5 hidden neurons can be used, as mentioned, in simulations of vehicle fuel consumption in WLTP homologation tests, for example. Based on vehicle speed and vehicle parameters (wheel radius, gearbox ratios, and vehicle weight), one can calculate engine speed and torque, and the ANN will calculate engine efficiency at every moment. A sample course of engine This characteristic allows a simple assessment of engine efficiency in the whole working range. The length of the measurement sections clearly shows the influence of individual components on the overall efficiency of the engine and, in particular, how it decreases where angular acceleration or torque increase occur. The main advantage of the characteristic is that it is a continuous and differentiable function, which allows the efficiency to be calculated at any working point.

Simulation Results and Comparison of Dynamic and Static Characteristic
The ANN network with 5 hidden neurons can be used, as mentioned, in simulations of vehicle fuel consumption in WLTP homologation tests, for example. Based on vehicle speed and vehicle parameters (wheel radius, gearbox ratios, and vehicle weight), one can calculate engine speed and torque, and the ANN will calculate engine efficiency at every moment. A sample course of engine parameters is presented in Figure 14, which allows the newly developed characteristic η dyn to be compared with the static characteristic η stat .
Energies 2019, 12, x FOR PEER REVIEW 12 of 13 parameters is presented in Figure 14, which allows the newly developed characteristic ηdyn to be compared with the static characteristic ηstat. It can be clearly seen that the engine efficiency drops by 10% during sudden throttle opening (2). In phase (3) when the torque is constant, the increase in engine speed decreases the efficiency by up to 15%. An unusual situation occurs in phase (4)(5). Sudden throttle closing results in air-fuel mixture depletion, however, the engine generates torque (due to the speed decrease). This leads to the situation that the engine efficiency reaches up to 42%, whereas its maximum efficiency in steady states is 33%. Phase (7) represents slow engine load and speed increase. In this situation, the  It can be clearly seen that the engine efficiency drops by 10% during sudden throttle opening (2). In phase (3) when the torque is constant, the increase in engine speed decreases the efficiency by up to 15%. An unusual situation occurs in phase (4)(5). Sudden throttle closing results in air-fuel mixture depletion, however, the engine generates torque (due to the speed decrease). This leads to the situation that the engine efficiency reaches up to 42%, whereas its maximum efficiency in steady states is 33%. Phase (7) represents slow engine load and speed increase. In this situation, the difference between characteristics is only 4%. Phases (1,4,6,8) represent static states, so η dyn = η stat . This proves that static characteristics (specific fuel consumption characteristic) can only be used in quasi-static conditions. Taking into consideration the accuracy requirements of modern simulation programs, as well as the wide range of engine operation, this is not enough. Only the newly developed characteristic can calculate engine efficiency in any working state with high accuracy.

Summary and Conclusions
The article presents a detailed algorithm for developing the combustion engine efficiency characteristic, both in a full version with 5 hidden neurons, dedicated for computer simulations, and a simplified one with only one hidden neuron, which visually describes the engine properties with the accuracy of 5% with regard to the detailed characteristic. Both methods describe every step exactly, including the coefficients of data scaling and weights and biases of both networks, which can be recreated by any researcher. ANN design and the training method prove the correctness of the presented attempt. The mse and regression plots are correct and R > 0.98, which also means that the network architecture and scaling methods were assumed correctly. However, one should remember that the specific values of weights and lengths reflect the specificity of the tested engine. With different propulsion, the weight and length coefficients will be different; however, the methodology remains the same. The example presented in Section 5 shows that the discrepancy between the static characteristic and the new characteristic can reach up to 15% in the case of high angular acceleration and sudden throttle opening. Scaling lengths ( Figure 13) clearly show the influence of each component (n, ε n , M, and ε M ) on the overall efficiency in the whole working range and allow a quick and precise assessment of the engine properties.