# Fitting water temp data to an exponential equation

Discussion in 'Physics & Math' started by Jennifer Murphy, Jan 1, 2017.

1. ### Jennifer MurphyRegistered Senior Member

Messages:
180
I'd like to fit some water heating data to an equation that will tell me how long to heat tap water in my microwave to achieve a specific temperature.

Here's some sample data:
Code:
Time   Start    End
1:00  66.7°  116.4°
1:30  69.1°  136.9°
2:00  72.0°  153.7°
2:30  70.0°  168.2°
3:00  66.7°  179.5°


The equation needs to have a horizontal asymptote at about 212°.

3. ### danshawenValued Senior Member

Messages:
3,950
http://mathworld.wolfram.com/LeastSquaresFittingExponential.html

Some have suggested that if you need an asymptote, try fitting the data instead into the logarithmic domain:

http://stackoverflow.com/questions/40148671/how-to-get-a-better-exponential-fit-using-gnuplot

You might also want to have a look at something like this:

http://cem.com/media/contenttype/media/literature/525_ApNote_Disc_Teach_GEN1.pdf

which is a laboratory exercise template for what it sounds like you are trying to accomplish. Is water the only thing you will be heating in the microwave? For most people, it is probably not. The water component is important, but it is only a component.

Last edited: Jan 2, 2017
Jennifer Murphy likes this.

5. ### Jennifer MurphyRegistered Senior Member

Messages:
180
Hmmm..., not sure I completely follow that one, but I do have a need to look into other asymptotic functions for a real project I am working on. So I'll spend more time trying to figure it out.
This is not a serious project. I'm collecting some data on heating water for tea so I can get a general idea of how long to heat it to get close to a specific temperature. When I plot the sample data I provided, it looked like an exponential growth curve, so I thought if I could find a reasonably good fit, I could build a little table telling me what time to set the microwave at to get water at, say, 180°.

But then I realized that there really isn't any asymptote. The water will come to a boil, not just get ever closer. So a polynomial fit is probably better.

Anyway, thanks very much for your help. Do you have all these links in your head or did you do a little research on my behalf?

danshawen likes this.

7. ### exchemistValued Senior Member

Messages:
7,202
Indeed. If your microwave is any good the water will boil.

By the way, do not use water significantly below boiling point to make tea. It is essential for good tea to have the water as hot as possible. This is why we warm the teapot first.

It is also why tea tastes crap in France, and often in the USA.

8. ### Confused2Registered Senior Member

Messages:
487
If your microwave is say 700W then the rate of loss by convection, conduction and radiation below 212F is probably going to be negligible. Consider a linear fit to the data. If no fit then I suggest the problem lies with the data. Some calculation of equilibrium temperature for a teacup with 700W input may follow. Anyone have time?

Russ_Watters likes this.
9. ### rpennerFully WiredRegistered Senior Member

Messages:
4,833
Phenomenologically, neglecting evaporation, to first order the energy per change in temperature is expected to have an affine relation with temperature of water.

Thus it's expected that for some constants A and B, the three entries in your table (T, S, E) are related by $T = \int_S^E (A + B t) \, dt \; = \; A \left(E - S\right) + \frac{B}{2} \left(E^2 - S^2\right)$

Which suggest a linear relation between the transformed columns.
$\begin{array}{rr|rr||r} \textrm{Start} & \textrm{End} & E - S & E^2 - S^2 & T \\ \hline \\ 66.7 & 116.4 & 49.70 & 9100.07 & 60 \\ 69.1 & 136.9 & 67.80 & 13966.80 & 90 \\ 72.0 & 153.7 & 81.70 & 18439.69 & 120 \\ 70.0 & 168.2 & 98.20 & 23391.24 & 150 \\ 66.7 & 179.5 & 112.80 & 27771.36 & 180 \end{array}$

Doing an exact arithmetic computation of the pseudo inverse of the transformed columns we have:
A = 5720299743598500/109830795551130389 ≈ 0.05208283993 seconds per degree °F
B/2 = 685721141481000/109830795551130389 ≈ 0.006243432346 seconds per degree °F squared

Thus the in-sample prediction is:
$\begin{array}{rr} \textrm{Predicted} \; T & \textrm{Observed} \; T \\ \hline \\ 59.4041885 & 60 \\ 90.7319874 & 90 \\ 119.3821250 & 120 \\ 151.1561593 & 150 \\ 179.2635516 & 180 \end{array}$

with the sum of squares of residuals being about 3.15.

This formula predicts to raise the temperature of 1°C or (9/5)°F centered at 15°C requires
S = 58.1°F , E =59.9°F, E−S = 1.8, E²−S² = 212.4, T ≈ 1.419854142 seconds
For a 700 watt microwave operating at 100% efficiency, this means about 994 Joules went into heating the water, which suggests you are heating about 237 grams of water, which is just about 1 cup of water.

Last edited: Jan 4, 2017
Confused2 likes this.
10. ### danshawenValued Senior Member

Messages:
3,950
I like Wolfram Alpha for its modeling, and have tinkered with a a few of those.

The microwave heating question comes up in a lot of forums, and usually rpenner gives the best mathematical answers, I have noticed. But it is an engineering problem also, and there are many stray variables (composition of the cup, which could be melamine or contain melamine -- not recommended because it could explode). And you can't take into account things like power transformer losses or microwave cavity coupling -- because it could be dirty, another source of losses.

Some microwaves come with a thermometer attachment, which is way cool, or you could even use one of those handheld pinpoint laser thermometers, which tend to read just a bit low, but are more hygienic.

The smart engineering thing to do would be to equip microwave ovens with laser thermometers, of course. Does any manufacturer do that yet?