Digital Twin with Python (VTR UGE 21), day 1 of 5

Concept and Architecture

Prof. Dr. Utku Kose, Süleyman Demirel University

Maturity lab

Part A classifies six systems as models, shadows or twins. Part B repeats the energy balance of the pack step by step, with sliders for its numbers. Part C runs the pack and a virtual counterpart in the browser, with the maturity level and the sensor of your choice. Part D repeats the root mean square error (RMSE) of the shadow step by step, also with sliders. Part E assigns responsibilities to the parts of the reference architecture. In Parts B and D every intermediate value is rounded, and the next step continues with the rounded value, as in a calculation by hand. Part F follows a courier with a delivery app and asks how often the phone should send its position and how the app should move the marker between two fixes.

Part A: Model, shadow or twin?

Classify each system by its data flows.

Back to the lecture: What is a digital twin?, where the text continues after the box of this part.

Part B: The energy balance of the pack, step by step

The worked examples of the lecture: the heating of the pack, its cooling by the air and the fan, the rate of change of its temperature, one Euler step, the steady state and the time constant. The sliders set the current, the cell temperature, the fan duty, the temperature of the air and the time step. The parameters are those of the pack: \(R = 0.045\) ohm, \(m c_p = 9000\) J/K, \(hA_0 = 2.2\) W/K and \(hA_1 = 12\) W/K. The left panel compares the two powers, and the right panel follows the temperature from now on, with the current and the fan held.

Back to the lecture: The asset of the course. The lecture continues there with Section 1 of the Colab notebook: Open it from the next orange box.

Part C: The maturity bench

Configure the virtual counterpart of the pack and the sensor that feeds it, then press Run and add to scoreboard. The plot shows the true temperature of the pack and what the counterpart believes. The twin may switch the fan; the model and the shadow only watch. Try a sensor bias of minus five degrees with the twin and compare the last two readouts.

Scoreboard

RunLevelSyncBiasNoiseLoss Belief RMSEPeakTruly over 46 °CReported over 46 °C

Back to the lecture: What each arrow buys. The lecture continues there with Section 2 of the Colab notebook: Open it from the next orange box.

Part D: The error of the shadow and the synchronisation interval

The formula of the lecture for the error of a shadow that overwrites its belief with every reading, term by term: the noise \(\sigma\) and the bias \(b\) of the sensor, the drift rate \(v\) of the model and the synchronisation interval \(\Delta t_{\mathrm{sync}}\). The drift rate is set in degrees per minute. The figure draws the whole curve on a logarithmic axis, as the animation of the lecture does, and marks the chosen interval. Beyond about twenty minutes the formula no longer holds, and the curve is dashed there.

Back to the lecture: How often should the twin listen?. The lecture continues there with Section 4 of the Colab notebook: Open it from the next orange box.

Part E: Who does what in the architecture?

Each responsibility belongs to one of the five parts of the reference architecture.

Back to the lecture: A reference architecture. The lecture continues there with Section 5 of the Colab notebook: Open it from the next orange box.

Part F: The delivery tracker

The courier of the lecture rides 3000 metres at 4 metres per second and waits 40 seconds at each of four traffic lights. Every fix carries the position, off by about 5 metres, and the speed. Choose the time between two fixes and the rule by which the app moves the marker until the next fix, run the trip and compare the runs in the table. For each rule, find the longest interval of the list that keeps the RMSE of the marker below 20 metres. Then compute two positions by hand, without the error of the fixes.

RunTime between fixesRuleFixes sent RMSELargest error

A fix at second 120 puts the courier at 482 metres with a speed of 4 metres per second, and the next fix comes at second 150. The fix of second 180 finds the courier waiting at the first light, at 600 metres with a speed of 0, and the courier rides on at second 190.

Back to the lecture: Your asset. The lecture continues there with Section 7 of the Colab notebook: Open it from the next orange box.