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

Data Pipelines and Model Calibration

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

Calibration lab

Part A fits the thermal model to synthetic readings in the browser by hand and shows the sum of squared errors and the three ratios that the data determine. Part B matches symptoms with faults of the data. Part C computes one step of a Kalman filter by hand.

Part A: The calibration bench

The dots are noisy temperature measurements of the pack over ninety minutes. Fit the model by hand with the four parameter sliders and watch the sum of squared errors, the sum of the squared differences between the dots and the curve. The four parameters are the internal resistance R0, the heat capacity m cp, the cooling conductance hA0 without the fan and the additional conductance hA1 at full fan. The noise alone leaves a sum of about 65, so no setting can go much lower. Then press Scale all four by 1.5: The curve does not move. Switch the experiment to fan never on and try to find the value of hA1.

The sliders move along the four parameters. The readout of the three ratios shows what the data actually determine: Equal ratios give an identical curve, whatever the four values are.

Open in ColabContinue in Colab, section 4: the hidden symmetry, verified down to the rounding error of the computer.

Part B: Which data problem?

Match each symptom with the fault of the data that causes it.

Open in ColabContinue in Colab, section 2: inject spikes, a gap and a drift, and apply the three rules.

Part C: One step of a Kalman filter by hand

The model predicts 40.0 C with a variance of 0.5. The sensor reads 41.5 C with a noise variance of 0.25. The Kalman gain is the prior variance divided by the sum of the prior and the noise variances.

Open in ColabContinue in Colab, section 7: the Kalman filter on the pack over ninety minutes.