# CarTwin--Development of a Digital Twin for a Real-World In-Vehicle CAN Network
## 6 Experimental Evaluation of the Digital Twin
### Results
20 ms, while the car CAN bus message that contains the odometer is transmitted every 1 s. However, the trip distance signal has a similar variation over time. **Highway. ** In Figure 16, we show the signals while the vehicle is driven on a highway. Again, the plots from the left side are the outputs from our simulation, i.e., Figure 16i,iii,v, while the plots from the right side are the signals collected from the real car, i.e., Figure 16 ii,iv,vi. For the vehicle speed signal, the model output varies between 90 km/h and 135 km/h, while the vehicle speed signal collected from the vehicle varies between 125 km/h to 148 km/h (with the exception of a few spikes to 80 km/h at the beginning of the plot). Engine speed varies between 2600 rpm and 3700 rpm in the model output, while in the vehicle trace, the signal value is more stable between 2600 rpm and 3400 rpm (except for a few spikes at the beginning of the plot between 1000 rpm and 4600 rpm). The trip distance signal from the model and the trip distance signal from the car have a similar variation in time. **Statistical comparison. ** As an additional metric for the accuracy of the model outputs, we compute the mean values for the differences between the output signals of the model and those from the vehicle trace and the correlation coefficient between these signals. To provide a comprehensive evaluation for the computed mean difference, we show several plots with the distribution of vehicle speed and engine speed signals from the model output, vehicle trace and the difference between them. The distribution of the vehicle speed from the model is shown in Figure 17i, with more than 20% of values in each of the following ranges: 0-20 km/h, 100-120 km/h and 120-140 km/h. The distribution of the engine speed from the model is shown in Figure 17 ii, with 30% of the values in the 3240-3780 rpm range and more than 20% of the values in the 540-1080 rpm and 2700-3240 rpm ranges. The vehicle speed from the vehicle trace has more than 30% of the values in the 132-154 km/h range while driving on the highway and around 25% of values in the 44-66 km/h range  
Figure 16: Signals computed by CarTwin models (**left**) and signals collected from a car (**right**) on highway. while driving on local roads, as shown in Figure 17 iii. The engine speed was in the 2800-3500 rpm range for more than 40% of occurrences in the vehicle trace and around 25% within the 1400-2100 rpm range, as illustrated in Figure 17 iv. The distribution for the vehicle speed difference is shown in Figure 17v, with 46% of values in the 0-20 km/h range and 80% of values in the 0-40 km/h range, while the distribution for the engine speed difference is shown in Figure 17 vi, with 60% of values in the 0-560 rpm range and 83% of values in the 0-1120 rpm range. Numerical data, which contains the bin width and the bin percentages for each of the seven bins from the distributions, is presented in Table 2.  
The distributions, mean difference and correlation coefficient values were computed for the entire trace, which includes both driving on the local road and the highway, and are shown in Table 3. Since the digital twin model is designed by us in MATLAB/Simulink, while the real-world vehicle is an actual physical system that is influenced by the environment, differences between the results are expected (both the vehicle and the environment are nearly impossible to model with absolute accuracy). The mean of the recorded differences is about 25 km/h for the vehicle speed and 610 rpm for the engine speed. We note that the range of the signals is computed according to the collected dataset, and the only common input that links the synthetic model with the physical is the signal applied to the brakes. The correlation coefficients between the synthetic data and the real-world data are 0.85 and 0.71, respectively (for the vehicle and engine speed), which shows a good to strong relation between the synthetic and the real-world result.