Digital Twin with Python (VTR UGE 21), day 2 of 5
Prof. Dr. Utku Kose, Süleyman Demirel University
Part A repeats one step of the three methods of the lecture, slope by slope, with sliders for its numbers. Part B integrates the thermal model of the pack with three methods and collects every run in a diagram of error against cost. Part C computes a stability limit and an order by hand. Part D runs the event list of a small charging depot, event by event, also with sliders. Part E chooses the kind of simulation for six systems. In Parts A and D every intermediate value is rounded, and the next step continues with the rounded value, as in a calculation by hand. Part F computes three Euler steps of a cooling cup of tea by hand, once with a stable and once with an unstable step.
The worked example of the lecture: one step of the thermal model of the pack with each of the three methods, compared with the exact solution. The slope at a temperature \(T\) is \(f(T)\)\({} = (I^2 R - (hA_0 + hA_1 u)(T - 35))\)\({} / 9000\) degrees per second, with \(R = 0.045\) ohm, \(hA_0 = 2.2\) W/K, \(hA_1 = 12\) W/K and air at 35 °C. The sliders set the step, the start temperature, the current and the fan duty. The figure draws the exact curve and the straight line along which each method moves through the step.
Back to the lecture: Integration and its accuracy, where the text continues after the box of this part.
Choose an integration method, a step size and a fan duty, from 0 for off to 1 for full power, and integrate the thermal model of the pack over two hours. The reference is the classical Runge-Kutta method of order 4, abbreviated RK4, with a step of one second. Every run is added to the scoreboard, where the plot of error against the number of derivative evaluations, the work-precision diagram of the lecture, shows which method buys accuracy most cheaply.
| Run | Method | Step | Fan duty | Evaluations | Final error |
|---|
Back to the lecture: Integration and its accuracy. The lecture continues there with Section 2 of the Colab notebook: Open it from the next orange box.
The pack has a heat capacity of 9000 J/K, a passive cooling conductance of 2.2 W/K and an extra 12 W/K at full fan. The stability limit of explicit Euler is twice the heat capacity divided by the total conductance.
Back to the lecture: The stability limit. The lecture continues there with Section 3 of the Colab notebook: Open it from the next orange box.
A discrete-event simulation of the charging depot of the lecture, small enough to follow by hand: six vehicles arrive with the states of charge 0.20, 0.35, 0.10, 0.40, 0.25 and 0.30 and are charged to 0.90 with a current \(I_c\), so that a charge takes \(t_c\)\({} = (0.9 - \mathrm{SoC}_{\mathrm{in}}) \times 60 / I_c\) hours. Each step takes the earliest event from the list, moves the clock to its time and carries it out. At equal times an end of charge goes first. The sliders set the number of bays, the charging current and the spacing of the arrivals, a factor on the arrival times 0, 0.3, 0.5, 1.1, 1.3 and 1.6 hours. The chart shows the bays and the line up to the clock of the current step.
Back to the lecture: A depot and a fleet. The lecture continues there with Section 5 of the Colab notebook: Open it from the next orange box.
Choose the family that fits each system best.
Back to the lecture: A depot and a fleet, where the text continues after the box of this part.
Tea at 90 °C cools in a room at 20 °C with a time constant of \(\tau = 10\) minutes. One step of explicit Euler multiplies the distance from the room temperature by \(g = 1 - \Delta t / \tau\). Compute three steps by hand, first with a step of 5 minutes and then with a step of 25 minutes, and type the temperatures. The chart draws your values next to the true curve as you type. Then give the longest step that keeps the method stable.
Step of 5 minutes
Step of 25 minutes
Back to the lecture: Your asset. The lecture continues there with Section 7 of the Colab notebook: Open it from the next orange box.
Answer each question, rate your confidence and check the answer. Results stay in this browser.
Write a short answer to each question. The text is saved in this browser and is included when you export the learning log.