Fit an Energy Balance to Data
Open the TCLab Simulation Studio app
Advanced Control Exercise 3 of 30 in Dynamic Models · All exercises · Time: 15 minutes
A model can come from physics, from data, or from both. Here it comes from both: the structure is an energy balance and its uncertain parameters are fitted to a step test you record. Three structures of increasing physical detail compete on the same data, and the optimizer that fits them is the same one that will later estimate states and plan moves.
Learning Outcomes
- Pose parameter estimation as an optimization problem with an objective, a model and bounds.
- Compare a first-order, a convective and a convective-plus-radiative model on the same data by their objective.
- Explain why a physics structure with fitted parameters extrapolates better than a pure regression.
Book Chapter
Process Dynamics, Modeling, and Identification (Volume 1), Chapter 11, Model Structure Selection and Identifiability on a Temperature Control Lab. Read the chapter, open the PDF, or watch the lecture slides.
Theory in Brief
The heater temperature `T` gains energy from the heater power `Q` (percent), loses it by convection and by radiation to the room at `T_a`:
$$m c_p \frac{dT}{dt} = U A \left(T_a - T\right) + \epsilon \sigma A \left(T_a^4 - T^4\right) + \alpha_1 Q$$
With `\epsilon = 0` this is the convective model, and the first-order model `\tau\, dT/dt = -(T - T_a) + K_p Q` lumps the physics into two numbers, `\tau = m c_p/(UA)` and `K_p = \alpha_1/(UA)`. The fit chooses the uncertain parameters `p` (here `U` and `\alpha_1`, or `\tau` and `K_p`) to minimize the sum of absolute errors between measured and simulated temperatures:
$$\min_{p} \; \sum_{k=1}^{n} \left| T_{meas,k} - T_k(p) \right| \quad \mathrm{subject\;to} \quad \text{the model},\;\; p_{lo} \le p \le p_{hi}$$
The absolute value weighs an outlier less than a squared error would. The physics fixes the structure: a convective-plus-radiative model fitted at one heater power still predicts the bend in the temperature at another, where a first-order regression extrapolates a straight line. If a fitted parameter ends at its bound, the data probably cannot separate it from another one.
Model: Combined. A physics-based energy balance whose uncertain parameters are fitted to recorded data.
Decision: The parameter values, chosen by an optimizer that minimizes the sum of absolute errors.
Learning: This is supervised learning with a physics structure; a neural network in place of the balance would need far more data to match it.
Exercise
Read 2 min · Predict 1 min · Run 7 min · Explain 3 min · Check your AI 2 min.
Predict. Rank the three model forms by their objective at their published values, before any fitting. Then guess how much Best fit will reduce the objective of the convective-plus-radiative form.
Run the TCLab Simulation Studio app. The studio runs up to 10×; the 5-minute step takes 30 s at that speed.
- In Step test program choose Q1 = 50% · 5 min. Set the speed to 10× and press Start a run. Let it run to the end.
- In Model form click First-order, then Convective, then Convective + radiative. Read the Objective for each at its published values.
- With Convective selected press Best fit and read the objective and the status line. Repeat with Convective + radiative.
Explain.
- Why does adding radiation lower the objective at the published values, and which feature of the curve does it capture?
- After Best fit, the convective and radiative forms reach similar objectives on this step. Which would you trust at 100 % heater power, and why?
Generative AI Learning
Check the answer against your run: A good answer prefers the physics model for extrapolation because radiation grows with the fourth power of temperature, and writes a sum of absolute or squared errors with parameter bounds. Compare its objective with the one on this page. The assistant is your tutor and reviewer; you answer for every claim you turn in.
What to Turn In
A table with one row per run and the numbers each step asks you to read, your written prediction, and three sentences that answer the two questions.

At their published values the objectives are 2709 °C for the first-order form, 1811 °C for the convective form and 1575 °C for the convective-plus-radiative form. Radiation adds a loss that grows quickly with temperature, so the radiative form bends over near the top of the step as the measurement does.
Best fit brings the convective form to 140 °C and the radiative form to 133 °C by adjusting `U` and `\alpha_1` only. On one step at one power the two fitted forms describe the data about equally well, because the fitted `U` absorbs most of the radiative loss near 50 %. They should part at 100 %, where the temperature is higher and the radiative loss, growing with `T^4`, is a larger share; only the form that has it in its structure can predict that. The app's case 10 (Use the 100% step) lets you test this. Choosing a model by its objective on one experiment rewards flexibility, not truth.
Measured with the app build of December 3, 2026 by a scripted replay of the steps above. Numbers that no tile shows come from the replay's record; your readings from the trends will be close. A later app release may move the last digit.
TCLab B and Physics-Informed fit this balance in GEKKO. Export the CSV, fit `U` and `\alpha_1` with `m.Minimize` of the absolute error (use slack variables for the absolute value), then predict a 100 % step with each fitted form and compare with the app's 100 % program.
Related
- Check yourself: three-question quiz
- Course pages: Physics-Informed, Machine Learning Introduction, Statistics, TCLab B
- Exercises: previous: 2 · Inverse Response From an Energy Balance; next: 4 · A Multivariable Model From Records Alone
References
- Hedengren, J. D. (ed.), Process Dynamics, Modeling, and Identification, Volume 1 of Interactive Control Engineering, Chapter 11, "Model Structure Selection and Identifiability on a Temperature Control Lab", pp. 258–283, Advanced Process Solutions, 2026. PDF (CC BY 4.0).
