2

I'm trying to calculate the new temperature of an object when the air temperature around it changes, given a period of time.

Basically I get periodic readings from an air temperature sensor in a refrigerator. In some cases these readings are every 5 minutes, in others every 1 minute, so the time between readings is variable.

For each reading I get, I'd like to also calculate the approximate temperature of food at its core; something like a chicken for example (I know that part is vague, but if there is a variable I can tweak then that is fine).

The result should be a "damped" version of the actual air temperature, as obviously any objects will slowly change temperature to eventually meet the air temperature.

Initially there used to be "food simulant" put around the sensor, so the temperature would automatically be damped, but this is no longer the case.

I do not know much about thermodynamics. I'm not sure if I can just add a percentage of the temperature change to the previous damped value, or if I need a calculation based on the last few air temperature readings, or what.

I guess I'm looking for a result a bit like:

10:00 2 degrees (air), 2 degrees (product)
10:05 2.5 degrees (air), 2.1 degrees (product)
10:10 2.5 degrees (air), 2.2 degrees (product)
10:20 2.7 degrees (air), 2.5 degrees (product)

I could do something really cheap like averaging the readings over the last 30 minutes but I don't think that will cut it!

I'm not really sure this is the correct forum for this question! I'd appreciate any help - thanks very much.

EDIT: I have since found a solution by reading up on Fourier's Law. I will post the solution once I have some time. Thanks to anyone who commented.

Mark
  • 1,296
  • 13
  • 28
  • 1
    Not sure this is in the right place. Perhaps you meant to ask in a science oriended Stack Exchange site? – David Roussel Aug 27 '14 at 09:47
  • You need to solve the heat equation to do this. (A second order PDE in 3 space dimensions: you'd get away with modelling a chicken as a homogenous sphere). You best ask on a physics site. Come back here though for any implementation questions; once you have a suitable sscce though. – Bathsheba Aug 27 '14 at 09:50
  • Thanks, I'll see if I can find an appropriate place to ask. – Mark Aug 27 '14 at 09:50
  • Try http://math.stackexchange.com Also you do not mention what software you are using, but Mathematica or R may be of use for this type of problem (once you know the maths behind what you want to do). – Rusan Kax Aug 27 '14 at 11:34

1 Answers1

0

A simple model would be to assume that the product changes temperature by a fraction of the difference between the product temerature and the air temperature.

airTemp = readAirTemp();
productTemp = productTemp + factor * (airtemp - productTemp);

If the time interval between readings changes, then you need to change the factor. The factor also depends on which product you want to emulate.

Let's assume a factor of 0.5 at a 5 minute time interval.

Example (core temperature of a 25 degree product placed in a 5 degree refridgerator):

Time   ProductTemp    Temp    Calculation:
0      25             5       <astart condition>
5      15             5       ptemp = 25 + 0.5 * (5-25)
10     10             5       ptemp = 15 + 0.5 * (5-15)
15      7.5           5       ptemp = 10 + 0.5 * (5-10)
20      6.25          5       ptemp = 7.5 + 0.5 * (5-7.5)
25      5.625         5       ptemp = 6.25 + 0.5 * (5-7.5)

A real physics model would consider heat transfer through thermal radiation, heat conduction and convection. However, having a single variable to tweak (factor) is a good start if you want a simple yet fairly realistic model.

Edit:

This is not an exact model. If you put something really hot in the fridge (like 1000 degrees), then radiation would be the leading term in the cooling equation and temperature would decline faster. The above model should work well when the difference is small. The factor would depend on the item (the things you mentioned and also the amount of energy it takes to change the temperature of the food and the shape of the food - thin food cools faster) and its surrounding (can air flow freely around it or is the fridge full).

Calculating the factor is by no means simple. I recommend that you put a thermometer in a couple of types of food, put them in the fridge and measure in 5 minute intervals and then calculate the factor for each food type. The factor would still be inexact - a small apple cools faster than a big apple and so on.

Klas Lindbäck
  • 33,105
  • 5
  • 57
  • 82
  • Is that an exact solution for the product temperature under any set of assumptions? It seems plausible since product temperature will decay (exponentially) toward air temperature if air temperature changes by steps. Without looking at my old heat transfer text book, I don't remember what the exact solution is; maybe you know. If it is exact, what is the appropriate value of `factor`? I suppose it must involve the heat conduction coefficient of the food and the heat transfer coefficient of the food/air interface. – Robert Dodier Aug 27 '14 at 16:34
  • My response was too long to right as a comment, so I added it as an edit to my answer. – Klas Lindbäck Aug 28 '14 at 07:36