Overview
Weeks 1 to 11 built models of the campus and used them to plan, control and protect it. Each model stayed fixed once it was written down. A digital twin goes further: It stays linked to its physical counterpart and follows it with the measured data [1, 2]. This week builds such a twin for the library B2 of the campus. The twin is calibrated, kept in step with the building and notices when the building changes.
flowchart LR A["What a digital twin is"] --> B["Calibration"] B --> C["Synchronisation"] C --> D["Drift and recalibration"] D --> S["The campus microgrid, stage 12"] S --> FT["In the field: The clock"] FT --> H["Learning machines"]
Every method on this page is also written as Python code in the Colab notebook of the week. Its code is divided into numbered sections. Each orange box on this page names the section whose code carries out what the text above the box explains. The box says what to run and what to look at in that section, and its button opens the Colab notebook at that place. The virtual laboratories, the practice parts and the self-assessment of the week are in the interactive lab. Each blue box opens one part of the interactive lab. The part ends with a link back to its box on this page, and the Colab notebook is always opened from the orange boxes here.
Python step 12: A twin as a class
Python code in the Colab notebook, right after Section 0 (setup). Open the Colab notebook and run this step cell by cell: It consists of short pieces of Python code with their explanations, a quick check and three exercises. Topics: Classes and objects · Fitting parameters with SciPy · A twin that corrects itself.
The step writes a room as a Python class that keeps its parameters and its temperature together. It fits the parameters of the room to measurements with the function least_squares of SciPy [3]. It then adds a method that corrects the temperature with a measurement [4]. These are the parts of the twin of the week. Students who have never programmed start with the start-here notebook of the course.
Weeks 1 to 11 modelled, measured, controlled, scheduled, connected, optimised, forecast and defended the campus. The library entered in Week 2 as a model with one heat capacity and one resistance.
This week turns that model into a digital twin that follows the library through three weeks of February.

What a digital twin is
Grieves and Vickers describe a digital twin as a virtual counterpart of a physical product, linked to it over its whole life [1]. The link carries data from the physical object to the virtual one and information back. Kritzinger and colleagues sort the models in use by the direction and the automation of this data flow [2].
| Level | Data from the object to the model | Data from the model to the object | On the campus |
|---|---|---|---|
| Digital model | Manual | Manual | The library of Week 2, with values typed in by hand |
| Digital shadow | Automatic | Manual | A model that reads the logged data every 15 minutes and shows its predictions on a screen |
| Digital twin | Automatic | Automatic | A model that also acts, for example by starting the heating earlier on a cold morning |
Tao and colleagues review the state of the art of digital twins in industry, from their concepts and key technologies to their applications [5]. Rasheed and colleagues review the modelling side: Physics-based models, data-driven models and their combination, with the data and the infrastructure that a twin needs [6]. This week builds a digital shadow of the library that is calibrated, synchronised and watched. Week 13 lets it act.
The twin of the library is the model of Week 2 with two more heat flows. The sun \(G\) enters through the windows with the solar aperture \(g\). The visitors, the lights and the computers add the internal gains \(q\) while the library is open:
\(T\) is the indoor temperature and \(T_{out}\) the outdoor temperature. \(C\) is the heat capacity in kWh/K and \(R\) the thermal resistance to the outside in K/kW, as in Week 2. \(P\) is the power of the heating in kW and \(G\) the sun on the windows in W/m², so \(g\) is in kW per W/m². The opening hours \(o\) are 1 while the library is open and 0 otherwise. The building management system (BMS) logs all of them every 15 minutes. The twin steps through the log with the Euler method of Week 2 and \(\Delta t = 0.25\) h:
A worked example. On a night of the first week of February, the heating holds the library at 17.00 °C with 2.00 °C outside. The heater meter shows 33.78 kW on average. The library of Week 2, with \(R = 0.40\) K/kW, would hold only \(T \)\({}= T_{out} \)\({}+ R\,P \)\({}= 2.00 \)\({}+ 0.40 \times 33.78 \)\({}= 15.51\) °C with that power. It runs 1.49 K too cold. The two numbers of the night alone suggest \(R = (17.00 - 2.00)/33.78 = 0.444\) K/kW.

Check your understanding. A model of the library reads the logged data every 15 minutes and shows its predictions to the facility manager, who adjusts the heating by hand. Which level is it?
Python code in the Colab notebook, Section 1. Open Section 1 of the Colab notebook and run it. The function library_history in the setup builds three weeks of the library, and simulate runs a twin over the rows of a table. The code prints the statistics of the first week and the error of the first twin, the library of Week 2. It then draws the first week with the twin and the heater.
- Which systems in your daily life have a digital shadow, and which have a digital twin?
- What could go wrong when the twin of the library starts to switch the heating by itself?
Calibration: Fitting the twin to the library
The library of Week 2 knows only the heater and the outdoor temperature. Over the first week of February it runs 3.27 K too cold on average, with a root mean square error (RMSE) of 3.395 K. Calibration searches the parameters that make the twin reproduce the measurements.
There are two ways to compare a model with data [7]. The equation error compares one step of the model, started from each measurement, with the next measurement. The output error runs the model over the whole period from the first measurement on and compares its output with all measurements. The twin runs on its own between measurements, so the output error is the right measure here:
Here \(y_k\) are the \(N\) measurements of the room sensor and \(\hat{T}_k(\theta)\) is the twin with the parameters \(\theta\). The calibration uses the first week of February. The second week checks the result, because a twin that fits only the week that it has seen may have learned its noise. Bacher and Madsen select such grey-box models of buildings step by step, from one heat capacity to several, with statistical tests [8].
A worked example. Four measurements of the library are 20.10, 20.40, 20.30 and 20.00 °C, and a twin gives 20.40, 20.20, 20.70 and 19.90 °C. The errors are 0.30, −0.20, 0.40 and −0.10 K. Their squares sum to \(0.09 + 0.04 + 0.16 + 0.01 = 0.30\), so \(\text{RMSE} \)\({}= \sqrt{0.30/4} \)\({}= \sqrt{0.075} \)\({}= 0.274\) K.
The function least_squares finds \(C = 30.41\) kWh/K, \(R = 0.440\) K/kW, \(g = 0.0178\) kW per W/m² and \(q = 7.33\) kW. The RMSE drops to 0.272 K in the first week and stays at 0.276 K in the second, which the calibration has not seen. The time constant of the calibrated library is \(R\,C = 13.38\) h, close to the 12 h of Week 2.
Not every parameter is fixed equally well by the data. The scene below draws the RMSE of many twins as a landscape over \(C\) and \(R\), with the sun and the visitors at their calibrated values.
Scene: The valley of the calibration. Every twin of the library has its own heat capacity C and resistance R. The relief on the table shows the error of the first week for all twins with C from 10 to 50 kWh/K and R from 0.30 to 0.60 K/kW. The sun and the visitors stay at their calibrated values. The five buttons follow the search from the library of Week 2 to the bottom of the valley. The views Across R and From above show the valley from two sides.
The valley is narrow across \(R\) and long along \(C\). The resistance sets the temperature that a given heating power can hold, which the data show in every hour. The heat capacity only sets how fast the room follows a change, so every \(C\) from 25 to 40 kWh/K keeps the RMSE below 0.5 K.

Check your understanding. Why is the calibrated twin tested on the second week of February?
Interactive lab, Part A. The reading room in 3D: Bookshelves, a reading table with visitors, the radiator under the window and the sensors on the wall and the window sill. The cabinet of the building management system logs them all. Calibrate the twin by hand and validate it on the second week. The results can be copied into the Colab notebook.
Python code in the Colab notebook, Section 2. Open Section 2 of the Colab notebook and run it. The function calibrate fits C, R, g and q by the output error with least_squares. The code prints the calibrated values and the RMSE of both twins in the two weeks. Paste the results of Part A into MY_TWINS, and the code runs each of your twins again. It then draws the two weeks with both twins.
- The calibration ran in a cold week of February. Would you trust the twin in May, and why?
- Which parameter would you measure directly instead of calibrating it, and how?
Synchronisation: Keeping the twin in step
Even a calibrated twin drifts away from the building when it runs on its own. Its small errors add up, and nobody tells it about a door that stays open for a while. A synchronised twin corrects its state with every measurement, as the Kalman filter of Week 6 does [9]. Each step first predicts the next temperature with the model and then moves the prediction towards the measurement:
The difference \(e\) between the measurement and the prediction is the innovation, and \(L\) is the gain of the synchronisation. With \(L = 0\) the twin ignores the sensor and runs open loop. With \(L = 1\) it copies the sensor, noise included. The Kalman filter would choose \(L\) from the variances of the model and the sensor. Here the gain is chosen by trying several values.
→ These formulas with numbers, step by step: Lab Part B, calculator, steps 1 to 4.
A worked example. The twin stands at 20.00 °C. Outside it is 4.00 °C, the heating delivers 60 kW, the sun gives 300 W/m², and the library is open. With \(C = 30.41\), \(R = 0.44\), \(g = 0.018\) and \(q = 7.33\), the heat flows sum to \((4.00 - 20.00)/0.44 \)\({}+ 60 \)\({}+ 0.018 \times 300 \)\({}+ 7.33 \)\({}= -36.36 \)\({}+ 60 \)\({}+ 5.40 \)\({}+ 7.33 \)\({}= 36.37\) kW. The prediction is \(20.00 \)\({}+ 0.25/30.41 \times 36.37 \)\({}= 20.00 \)\({}+ 0.299 \)\({}= 20.30\) °C. The sensor reads 20.47 °C, so \(e = 0.17\) K. With \(L = 0.3\) the twin moves to \(20.30 + 0.3 \times 0.17 = 20.35\) °C.
The simulated library knows its true temperature, which no sensor shows. Over the second week, the sensor misses it by 0.102 K (RMSE) and the open-loop twin by 0.256 K. With \(L = 0.3\) the twin misses it by only 0.059 K. It beats its own sensor, because it combines the noisy readings with the physics of the building. With \(L = 1\) the twin returns to the 0.102 K of the sensor.
Animation. The gain of the synchronisation. Choose the gain L and watch the twin follow the library through Wednesday 11 February. The readouts give the errors over the whole second week. With L = 0 the twin runs open loop, and with L = 1 it copies the sensor.
Synchronisation also concerns time. Every value in the log carries a time stamp, and the twin pairs the values with the same stamp. Suppose that the heater meter stamps its values 30 minutes too late. The heat then seems to arrive half an hour after the room warms up. The calibration gives \(q = 5.15\) instead of 7.33 kW and \(R = 0.461\) instead of 0.440 K/kW, with an RMSE of 0.514 K instead of 0.272 K. The Network Time Protocol (NTP) keeps the clocks of networked devices together [10].
Someone who walks through a familiar flat at night counts their steps to know where they are. Each touch of a wall corrects the count a little. Without touches, the error grows with every step. If a single touch overruled the count completely, a pile of books mistaken for the wall would send them the wrong way. The gain L is the trust in the touch.

Check your understanding. Why can the synchronised twin know the temperature better than its own sensor?
Interactive lab, Part B. The calculator of the week computes one step of the synchronised twin: The heat flows, the prediction, the innovation and the correction. It ends with the standardised innovation of the next section.
Python code in the Colab notebook, Section 3. Open Section 3 of the Colab notebook and run it. The code runs the calibrated twin over the second week with six gains and compares it with the true temperature. The function late shifts the time stamps of the heater meter, and the code calibrates the twin again for five shifts. It then draws the error against the gain and one day with the twins.
- A cheaper sensor with twice the noise is offered for the library. Which gain would the twin need, and what would it lose?
- Which clocks of the campus must agree, and how would you check them?
Drift and recalibration
A building changes. A window stays open, a door is propped open, a radiator valve sticks or a new group of computers moves in. The calibrated parameters then no longer describe the building, and the twin must notice it and adapt. In the third week of February, a window of the reading room stays open from Wednesday 10:00 to Thursday 16:00.
The walls of the library conduct heat with 0.48 K/kW and the gaps of the closed windows with 6.0 K/kW. The two paths work in parallel:
The open window lowers the resistance of the window path to 0.7 K/kW, and the whole resistance drops to \(1/(2.083 + 1.429) = 0.285\) K/kW. At the same temperature difference, the library then loses 56 percent more heat.
The twin notices the change in its innovations. While the twin fits the building, they are small and scatter around zero. When the building loses more heat than the twin expects, they turn negative and stay negative. The cumulative sum (CUSUM) of Week 10 collects them [11]. It standardises each innovation with its spread \(\sigma\) in a normal week and sums the deviations beyond \(\kappa\):
The twin uses \(\kappa = 0.5\) and \(h = 5\), and the CUSUM restarts at zero after each alarm.
→ The standardised innovation with numbers: Lab Part B, calculator, step 5.
A worked example. Four innovations of the twin with \(L = 0.3\) give \(z = -0.4, -1.8, -2.6\) and \(-3.1\). The lower sum is \(S^- = \min(0, -0.4 + 0.5) = 0\), then \(-1.8 + 0.5 = -1.3\), then \(-1.3 - 2.6 + 0.5 = -3.4\) and \(-3.4 - 3.1 + 0.5 = -6.0\). The fourth value lies below \(-5\): An alarm.
The twin with \(L = 0.3\) raises its first alarm at 10:45, 45 minutes after the window opens, and none before it. The alarms repeat while the window stays open and stop when it is closed. Two more follow on Friday, because the CUSUM also reacts to the ordinary errors of a twin with a single heat capacity. The open-loop twin, in contrast, raises seven false alarms before the opening, and its first alarm after it comes only after 90 minutes.
Recalibration adapts the twin. Every hour, the twin server fits \(R\) again to the last hours of data, with \(C\), \(g\) and \(q\) kept at their calibrated values. A golden-section search finds the best \(R\) between 0.1 and 1.2 K/kW, and each of its steps shrinks the interval around the minimum by the factor 0.618. It is the limit of the optimal search for the peak of a function with a single peak that Kiefer described [12].
The length of the sliding window sets a trade-off. A window of 12 hours finds the open window first: At Thursday 08:00 it gives \(R = 0.286\) K/kW, against the true 0.285 K/kW. A window of 24 hours gives 0.293 K/kW and one of 48 hours only 0.376 K/kW. The short window pays with noise. While the windows are closed, its estimates scatter between 0.42 and 0.46 K/kW, against 0.43 to 0.45 K/kW for a window of 24 hours.

Check your understanding. Why does the open-loop twin raise false alarms before the window opens?
Interactive lab, Part C. The operations room in 3D: The rack with the twin server, the log database, a time server with a receiver of the Global Positioning System (GPS) and a network switch. The wall screen of the twin, a camera of the reading room and the monitors of the operator complete the room. Run the third week with different gains and windows. The results can be copied into the Colab notebook.
Python code in the Colab notebook, Section 4. Open Section 4 of the Colab notebook and run it. The function watch runs the synchronised twin over the third week with the CUSUM on its innovations, and recalibrate_R is the golden-section search. The code prints the alarms for five gains and the recalibrated R for three windows. Paste the results of Part C into MY_RUNS, and the code repeats each of your runs. It then draws the third week.
- The twin finds a new R every hour. When should the facility manager trust it, and when should someone walk to the reading room?
- Which changes of the library would a recalibration of R alone not capture?
Development templates of the week
The folder templates/ of the repository collects small working programs that carry out the methods of the course. Week 12 adds two of them, each with a description, its inputs and outputs and an example run.
| Template | What it does |
|---|---|
twin_calibration.py | Output-error calibration of a first-order thermal twin with heating, sun and internal gains from a log in a file of comma-separated values, with the RMSE of the calibration and the validation; the example is the library of the campus |
synchronised_twin.py | A twin as a class with the prediction, the correction by a gain, the CUSUM on the innovations and the recalibration of R by a golden-section search over a sliding window; the example is an open window |
The engineering side: Running a twin
A twin in daily use is a piece of software with data, models and users. Its models must travel between tools. The Functional Mock-up Interface (FMI) packs a model into a Functional Mock-up Unit (FMU) that different simulation tools can run [13]. Its data must share one clock, and every result must name the version of the model that produced it.
| Practice | Why it matters for the twin of the library |
|---|---|
| Time stamps in Coordinated Universal Time (UTC) from synchronised clocks | A shift of 30 minutes in one column raises the error of the calibration from 0.272 to 0.514 K |
| Calibration and validation on separate periods | A twin that fits only its own data can fail on the next week |
| Versions of the model and its parameters, stored with every result | A prediction can be traced to the model that made it, also after a recalibration |
| Logs of the innovations and the alarms | A drift shows up before the twin gives wrong advice |
| Models exchanged as FMUs | A model built in one tool runs in the tool of the operator |
| A written range of validity | The twin of February should not plan the summer without new data |
- Who on the campus should own the twin of the library: The facility management, the information technology (IT) department or the energy office? Why?
- The twin advises to preheat earlier on cold mornings. Who checks the advice before it reaches the heating?
The campus microgrid, stage 12: A twin that follows
Stage 12 gives the campus its first digital twin. It is calibrated on one week of the library, validated on another, synchronised with every measurement and watched for drift.
| Question | Result | Method |
|---|---|---|
| First twin, the library of Week 2 | RMSE 3.395 K in the first week, 3.27 K too cold on average | Euler simulation of Week 2 |
| Calibrated twin | C = 30.41 kWh/K, R = 0.440 K/kW, g = 0.0178, q = 7.33 kW | Output-error least squares |
| Error of the calibrated twin | 0.272 K in the first week, 0.276 K in the second | Calibration and validation |
| Synchronised twin, L = 0.3 | 0.059 K from the true temperature, against 0.102 K for the sensor | Prediction and correction |
| Heater meter stamping 30 minutes late | RMSE 0.514 K instead of 0.272 K | Calibration with shifted time stamps |
| Open window, CUSUM on the innovations | First alarm 45 minutes after the opening, none before | CUSUM of Week 10 |
| Resistance recalibrated at Thursday 08:00 | 0.293 K/kW with a window of 24 hours; true 0.285 K/kW | Golden-section search |
The stage turns a model of an earlier week into a copy of one building that stays up to date. The same steps carry over to the battery, the chargers and the feeders: Calibrate on one period, validate on another, synchronise every step and watch the innovations. Week 13 asks the twin what-if questions and uses it to plan maintenance.

Check your understanding. Which number of stage 12 shows that the twin has not only learned the noise of its own week?
Interactive lab, Part D. Stage 12 by hand: One prediction and one correction of the twin at night, and the resistance of a room with an open window.
Python code in the Colab notebook, Section 5. Open Section 5 of the Colab notebook and run it. The code collects the results of stage 12 in the dictionary STAGE12 and draws the errors of the twins and the recalibrated resistance.
In the field: The clock of the heater meter
The heater meter of the library, a heat meter on its heating circuit, stamps every value of its log with its own clock. Such a clock drifts, and nobody notices it until the twin pairs the heat with the wrong quarter of an hour. A comparison with a reference shows the offset. The campus has a time server that takes the time from GPS and serves it with NTP [10].
Setting the server corrects the stamps of the future, not those of the past. The logs of the last week keep the offset of the drifting clock, so their stamps are moved back by the measured offset before the twin learns from them. A meter that is 12 minutes ahead stamps a value of 10:00 as 10:12, and the correction moves it back to 10:00. The stamps stay in Coordinated Universal Time, also when the local time of the campus is three hours ahead, because all logs of the campus must share one clock.
Interactive lab, Part E. The field task: The heater meter, the time server of the campus and the twin. Measure the offset of the clock, set the time server and recalibrate the twin.
Your application
Wherever a quantity rises and falls like the temperature of a room, a first-order twin can follow it. The Colab notebook holds an application switch with six systems. They are a cold store, an aquarium, a server room, a greenhouse, a hot water tank and the cooling of the battery container of the campus.
Python code in the Colab notebook, Section 6. Open Section 6 of the Colab notebook, set APP to one of the six names in the comment and run the cell. The function app_twin simulates six days of the system, calibrates its twin on four days, tests it on two and synchronises it.
Learning machines in digital twins
The twin of this week is a grey-box model: Its form comes from physics, and its four parameters come from data. A purely data-driven twin would learn the whole relation from the log, for example with the regression of Week 10 or with a neural network. It needs more data and may break physical laws outside the range of its training data.
Physics-informed neural networks combine both [14]. A network learns the temperature as a function of time, and its training penalises the error against the data and also the violation of the differential equation. Raissi and colleagues show that such networks can also find unknown parameters of the equation from data. Rasheed and colleagues discuss such combinations of physics-based and data-driven models under the name hybrid analysis and modelling [6].
Suppose that the twin of the library keeps its physical model and adds a small network. The network learns the remaining error from the time of day, the occupancy and the weather. The physics carries the twin through situations that the log has never shown, such as an unusually cold night. The network corrects the patterns that the physics leaves out, such as an evening when the lights of the reading room stay on. The CUSUM on the innovations still guards both parts.
- For which systems of the campus would you build a purely data-driven twin, and for which a grey-box twin?
- A learned twin predicts the library well for a year and then fails in the first heat wave. What went wrong?
Review cards
Select a card to turn it over.
References
[1] Grieves, M., & Vickers, J. (2017). Digital twin: Mitigating unpredictable, undesirable emergent behavior in complex systems. In F.-J. Kahlen, S. Flumerfelt, & A. Alves (Eds.), Transdisciplinary Perspectives on Complex Systems: New Findings and Approaches (pp. 85-113). Springer. https://doi.org/10.1007/978-3-319-38756-7_4
[2] Kritzinger, W., Karner, M., Traar, G., Henjes, J., & Sihn, W. (2018). Digital Twin in manufacturing: A categorical literature review and classification. IFAC-PapersOnLine, 51(11), 1016-1022. https://doi.org/10.1016/j.ifacol.2018.08.474
[3] Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., Burovski, E., Peterson, P., Weckesser, W., Bright, J., van der Walt, S. J., Brett, M., Wilson, J., Millman, K. J., Mayorov, N., Nelson, A. R. J., Jones, E., Kern, R., Larson, E., Carey, C. J., Polat, İ., Feng, Y., Moore, E. W., VanderPlas, J., Laxalde, D., Perktold, J., Cimrman, R., Henriksen, I., Quintero, E. A., Harris, C. R., Archibald, A. M., Ribeiro, A. H., Pedregosa, F., van Mulbregt, P., & SciPy 1.0 Contributors. (2020). SciPy 1.0: Fundamental algorithms for scientific computing in Python. Nature Methods, 17(3), 261-272. https://doi.org/10.1038/s41592-019-0686-2
[4] Van Rossum, G., & Drake, F. L. (2009). Python 3 Reference Manual. CreateSpace.
[5] Tao, F., Zhang, H., Liu, A., & Nee, A. Y. C. (2019). Digital Twin in industry: State-of-the-art. IEEE Transactions on Industrial Informatics, 15(4), 2405-2415. https://doi.org/10.1109/TII.2018.2873186
[6] Rasheed, A., San, O., & Kvamsdal, T. (2020). Digital Twin: Values, challenges and enablers from a modeling perspective. IEEE Access, 8, 21980-22012. https://doi.org/10.1109/ACCESS.2020.2970143
[7] Ljung, L. (1999). System Identification: Theory for the User (2nd ed.). Prentice Hall.
[8] Bacher, P., & Madsen, H. (2011). Identifying suitable models for the heat dynamics of buildings. Energy and Buildings, 43(7), 1511-1522. https://doi.org/10.1016/j.enbuild.2011.02.005
[9] Kalman, R. E. (1960). A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1), 35-45. https://doi.org/10.1115/1.3662552
[10] Mills, D. L. (1991). Internet time synchronization: The network time protocol. IEEE Transactions on Communications, 39(10), 1482-1493. https://doi.org/10.1109/26.103043
[11] Page, E. S. (1954). Continuous inspection schemes. Biometrika, 41(1-2), 100-115. https://doi.org/10.1093/biomet/41.1-2.100
[12] Kiefer, J. (1953). Sequential minimax search for a maximum. Proceedings of the American Mathematical Society, 4(3), 502-506. https://doi.org/10.1090/S0002-9939-1953-0055639-3
[13] Blochwitz, T., Otter, M., Arnold, M., Bausch, C., Clauß, C., Elmqvist, H., Junghanns, A., Mauss, J., Monteiro, M., Neidhold, T., Neumerkel, D., Olsson, H., Peetz, J.-V., & Wolf, S. (2011). The Functional Mockup Interface for tool independent exchange of simulation models. In Proceedings of the 8th International Modelica Conference (pp. 105-114). Linköping University Electronic Press. https://doi.org/10.3384/ecp11063105
[14] Raissi, M., Perdikaris, P., & Karniadakis, G. E. (2019). Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378, 686-707. https://doi.org/10.1016/j.jcp.2018.10.045