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.
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.