Write Up 12

When Can I Drink My Coffee?

by: Angel R. Abney

During the summers, I used to stay at home in Rentz, GA and go to school at Georgia Southern University in Statesboro. Some mornings, I would stop in Dublin to get coffee at McDonalds, but I wouldn't be able to drink it until I was almost in Metter, which was about one hour down I-16. I decided to use McDonalds' coffee to collect data and then use this data to construct a function that would model the data. I recorded the temperature of the coffee at McDonalds, where the room temperature was 70.5 degrees Fahrenheit, every minute for thirty minutes. The data, which was recorded in Excel, is below.

time Temp
0 185.4
1 182.9
2 179.8
3 176.4
4 173.9
5 171.2
6 168.9
7 166.6
8 164.4
9 162.4
10 160.3
11 158.4
12 156.4
13 154.6
14 152.8
15 151.3
16 149.5
17 148
18 146.4
19 145
20 143.7
21 142.2
22 140.6
23 139.4
24 138
25 137
26 135.9
27 134.7
28 133.8
29 132.7
30 131.8

A plot of the data in excel is shown below.

The next goal is to construct a function that will model this data. Newton's Law of Cooling states that the rate at which the temperature T(t) changes in a cooling body is proportional to the difference between the temperature of the body and the constant temperature Ts of the surrounding medium. This situation is represented as the first order initial-value problem:

where Ts is the surrounding temperature, T0 is the initial temperature, and k is the constant of proportionality. Since the room temperature is 70.5 degrees, Ts = 70.5, and the initial temperature, T0 = 185.4. Therfore, using the model, the differential equation with the initial condition for the coffee is

Notice, the above differential equation is seperable and separating the variables gives us

So . Using the properties of natural logarithms and simplifying yields

where . Applying the initial condition, T(0)=185.4 implies that 185.4=C1+70.5, so C1=114.9. Therefore, the solution of the equation is


but what is k and how do we determine k? We need another condition to determine k. I will use the last data point at 30 minutes to determine k. T(30)=131.8. Applying this condition yields

Solving for k, we get k = -.0209427447. Therefore, using Newton's Law of Cooling, the equation that models the temperature of the coffee is

Notice that since k<0, the limit as t approaches infinity of T(t) is the room temperature, 70.5. So the temperature of the coffee approaches that of its surroundings.


Now, the big question! Does the model fit the data? The plot below shows the thirty actual data points along with the plot of the model above.


We can see that the model is a very good fit for the data. We can also see that the graph is beginning to approach the limit Ts = 70.5. Notice that using the model to predict the temperature after 45 minutes, we get a temperature of 115.3 degrees. After 60 minutes, the predicted temperature is 103.2 degrees and after 300 minutes, the predicted temperature is 70.7. This value is very close to the limit.

Now, we need to calculate a measure of the error between the model and the observed data by taking the relative error, which is

for each time from 0 to 30, where T(a) is the actual temperature and T(p) is the predicted temperature. Then, we Find the sum of the error and divide by the number of data points, 31. Thus, finding the average relative error.

To see the actual values in the spreadsheet, click here. We found the average relative error to be approximately 0.01.

My personal temperature preference is about 115 degrees; so using my model, it appears that I will have to wait approximately 45 minutes.

Return to Angel Home.