THAT: Temperature Model
published 2026-04-28
by Christopher Howard
[CORRECTION posted on 2026-05-05:
The model below is fundamentally flawed because the equation should be
d T_i / d t = (Q_heater − A × U × (T_i − T_o)) / (m × c)
I noticed my error when I realized that the expression A × U × (T_i − T_o) gives output in watts, whereas expression Q_heater / (m × c) gives output in K/s. I think the simulation curves would look similar, using the correct equation, but the effects of heat loss would not be as strong, and therefore you would be able to reach a higher internal temperature for a given heater wattage and ambient temperature.]
To experiment more with my THAT analog computer, I have been looking into wiring up a model for pressure simulation involving an ideal gas in a fixed volume container. Initially I was just wanting to incorporate a heat source, while neglecting heat transfer to the environment, i.e., assume a very well insulated container. But this is boring because in that case the equation simplifies to a few multiplications with no feedback loop. You can calculate the rate of pressure change without even keeping track of the temperature inside the container.
If we include heat transfer to the environment, i.e., heat leakage, then we require temperature feedback because the leakage is a factor of the difference between the inside and outside temperatures. The equation for that — adapted from the Internet — is
Q_loss = A × U × (T_i − T_o)
where
- A is the surface area of the container
- U is heat transfer coefficient of the container walls
- T_i is the temperature inside the container
- T_o is the ambient temperature or temperature outside the container
Our container also has a heat source, say, a heating element inside. Putting this together with the heat loss, we have
d T_i / d t = Q_heater / (m × c) − A × U × (T_i − T_o)
where
- Q_heater is the power of our heating element
- m is the mass of the ideal gas inside the container
- c is the specific heat capacity of our ideal gas
At this point, we could continue on to calculate our pressure as well. But the simulation was already getting complicated so I thought I would try first setting up a circuit for just temperature. Here is my sketch of the circuit:
sketch of circuit for heat transfer model
I blurred out a name and phone number that I had, in a moment of convenience, scribbled onto the paper.
Here is a screenshot from the scope, for a heating simulation:
scope view of heating simulation
The curve rises quickly but starts to level off as the gas starts to get significantly hotter than the outside temperature, so that heat loss is happening at a faster rate.
Here is another simulation where I turn the heater off completely and set the gas initial temperature to be higher than the outside temperature. Heat exchange causes the gas to cool down until reaching equilibrium with the outside temperature.
scope view of cooling simulation
Copyright
This work © 2026 by Christopher Howard is licensed under Attribution-ShareAlike 4.0 International.