## 5 Methodology  
### General Simulation Model  
In accordance with our goals, we developed a simulation-based method for energy consumption calculation. In the initial phase of our project, we constructed the main model, which focuses on vehicle dynamics. The preliminary objective was to develop a functional BEV vehicle model and subsequently adapt it to a range of actual vehicle models. The Jaguar I-Pace was selected as the model vehicle for the experimental measurements, as it was the only vehicle of the specified type that was available. The Jaguar I-Pace is a standard battery electric vehicle with a four-wheel drive (4 WD) dual-motor layout and a nominal battery capacity of 90 kWh. The initial stage in the development of a scalable simulation tool that can be re-calibrated for other electric vehicle models is the creation of a model of the vehicle in question [39]. The input parameters (in the case of the I-Pace) regarding the general simulation model are listed in the following Table 1:  
Our goal in creating this model is to build a simulation tool that can perform sufficiently accurate dynamic calculations for a wide range of vehicle dynamics scenarios. Given that the 0 to 100 km/h acceleration time is publicly available from the original equipment manufacturer (OEM), this scenario was chosen to verify the dynamic behavior of the simulation model. According to the I-Pace catalogue data, the vehicle can accelerate from 0 to 100 km/h in 4.8 s. The simulation model we developed also delivered the same result, which proved the model's applicability. The diagram above (Figure 2) demonstrates that the simulation of the vehicle propulsion and dynamics are sufficiently precise for use in our system. The model was constructed (see Figure 3) using the Simscape and the Vehicle Dynamics Blockset libraries. The system is fed with measurement data and a variety of environmental data. The recorded data include vehicle speed, Global Navigation Satellite System (GNSS) coordinates (lateral and longitudinal), vehicle high-voltage battery \begin{table}
\begin{tabular}{l c} \hline
**Vehicle Information** & **Data** \\ \hline Acceleration 0–100 km/h & 4.8 s \\ WLTP low consumption & 22.0 kWh/100 km \\ Maximum power & 294 kW \\ Maximum torque & 696 Nm \\ Unladen weight EU & 2208 kg \\ Height & 1566 mm \\ Length & 4682 mm \\ Width & 2139 mm \\ Front-wheel track & 1643 mm \\ Rear-wheel track & 1662 mm \\ Wheelbase & 2990 mm \\ Standard ride height & 174 mm \\ \hline \end{tabular}
\end{table} 
Table 1: Used Jaguar I-Pace catalogue data. SOC data, environmental temperature, cabin temperature, and calculated consumption data from the vehicle board computer. The described BEV model is fed with the above-mentioned measured data, which were recorded during the vehicle measurements activity. The environmental data include feedback from the vehicle dynamics simulation, which were calculated during the simulation model runtime. The dataset is processed and then separated into three distinct datasets, the first of which is the vehicle control subsystem. The operation of the control module results in the speed required during movement, which is used to determine the required motor torque and braking force. Since, an initial velocity dataset is not sufficient to control an open loop system, the Automated Driving toolbox was applied. For longitudinal control, the Longitudinal Controller Stanley block was used [40]. This control is based on a Proportional Integral (PI) Controller, the working principle of which is described by the following formula:  
\[u(j)=(K_{p}+K_{i}*\frac{T_{s}*z}{z-1})*e(j) \tag{1}\]  
where  
* \(u(j)\) is the control signal at the \(j\)th time,
* \(K_{p}\) is the proportional gain of the control,
* \(K_{i}\) is the internal gain of the control,
* \(T_{s}\) is the sample time of the block,
* \(z\) is the sample time of the simulation,
* \(e(j)\) is the velocity error at the \(j\)th time.