## 4 Calculation Methodology  
As anticipated, the final aim of this work is to carry out the transient simulation of the IC engine integrated with a complete vehicle model, considering the real driving conditions. The analysis conducted is summarized by the following steps:  
1. development of the engine simulation model. 2. validation of the model at fixed point operating conditions. 3. vehicle and engine model integration. 4. vehicle dynamics simulation in real driving conditions. During the first two steps of the activity, the 1D engine model is refined and then validated under steady-state conditions throughout the whole engine map. The simulation code iterates the calculation by studying all the operating points in sequence. Once the results obtained match the experimental data with minor discrepancy, the simulation of transient operation of the engine can be investigated through step 3 and step 4. The 1D model is reported in Figure 3.  
Figure 2: 210 kW (red points) and 235 kW (blue circles) engine operating maps (BMEP as function of engine speed). Relying on the coupling functionality of the simulation tool, the 1D engine model can be exported to the Simulink(r) environment by means of an S-Function block. This possibility is exploited for the vehicle simulation, which is performed by means of the vehicle tool: this software is a Simulink(r) add-on that allows the simulation of the longitudinal dynamics of vehicles with a large variety of architectures [21]. The vehicle model consists of different sub-system blocks, each one in charge of a specific task, to represent the specific devices along the powertrain such as gearbox, electric motor, and battery as described with more details in [4]. The IC engine model operating in transient conditions is represented by the simplified scheme reported in Figure 4.  
In Figure 4 the S-Function block in light yellow contains the engine 0D/1D thermofluid dynamic model, which acts as virtual engine solver. All the parameters to be set or monitored and controlled while the engine is running are highlighted in the green and blue box. The complete transient model receives as input the target torque and the engine speed as function of time: these are used to define the required engine parameters for the current engine speed and load by means of interpolation tables. The controllers (green blocks)  
Figure 4: Schematic representation of the IC engine transient model. Figure 3: Gasdyn 1D schematic of the 6-cylinder, turbocharged Diesel engine investigated in this study. The “CoSim” input/output objects are clearly visible; “CoSim” input ports are represented in blue circular elements, whereas the “CoSim” output ports are highlighted in green. determine the actuated quantities such as injected fuel mass, wastegate valve opening and inter-cooler wall temperature, which enter the virtual engine S-Function. Finally, the S-Function block provides the desired outputs. This complete engine model, operating in transient conditions, can be coupled to the conventional vehicle model, improving the basic representation of the IC engine by means of measured steady-state operating maps. The standard vehicle simulation tool reproduces the behavior of the different vehicle components, including the engine, by pre-determined tables and via interpolation, every output quantity requested can be instantly calculated without considering the dynamics of the device. To introduce the engine model by an S-Function block, the pre-existent vehicle velocity control is modified as reported in Figure 5, which shows the simulation architecture. While in the conventional approach, the output torque of the engine is simply determined via interpolation of the engine maps. The proposed methodology instead asks the running engine model to produce the required torque. This implies that the output torque of the engine might not be equal to the target but reflects the fluid dynamic solution obtained, hence it is affected by the intrinsic inertia and unsteadiness of the engine.