Case Study Practical Walkthrough: Coffee Cooling Model | 案例分析实战演练:咖啡冷却模型

📚 Case Study Practical Walkthrough: Coffee Cooling Model | 案例分析实战演练:咖啡冷却模型

In this article, we tackle a typical Pre-U Cambridge Mathematics case study: modelling the cooling of a cup of coffee using collected data, transforming a non-linear relationship, performing linear regression, and critically evaluating the model. You will be guided through each step, from raw data to final prediction, with full calculations and interpretative commentary. This walkthrough strengthens your ability to link pure mathematics and statistics in a real-world context.

本文演练一个典型的 Pre-U 剑桥数学案例分析:利用收集到的数据对一杯咖啡的冷却过程进行建模、将非线性关系线性化、执行线性回归并对模型进行批判性评价。从原始数据到最终预测,我们将逐步引导,提供完整的计算与解读注释。这次演练旨在加强你在真实情境中联系纯数学与统计的能力。

1. Introduction to the Case Study | 案例介绍

A scientist places a freshly brewed cup of coffee in a room maintained at a constant temperature of 20 deg C. She records the coffee temperature every few minutes over a 15-minute period. The aim is to find a mathematical model that describes the cooling behaviour, test how well it fits the observations, and use it to forecast the temperature at a later time. This type of problem appears frequently in Pre-U papers under ‘Modelling with differential equations’ and ‘Statistical analysis of data’.

一位科学家将一杯刚煮好的咖啡放置在保持恒温 20 °C 的房间内。她在 15 分钟内每隔几分钟记录一次咖啡的温度。目标是找到一个描述冷却行为的数学模型,检验模型与观测数据的拟合程度,并利用它预测稍后的温度。这类问题常见于 Pre-U 考试中“微分方程建模”与“数据的统计分析”部分。

2. Presenting the Data | 数据展示

The recorded time t (minutes) and temperature T ( deg C) are shown in the table below. We also include a column for the excess temperature above room temperature, T – 20, which will be central to our model.

记录的时间 t(分钟)与温度 T(°C)如下表所示。我们还增加了一列超出室温的温度值 T – 20,它将在建模中起到核心作用。

t (min) T ( deg C) T – 20 ( deg C)
0 92 72
2 84 64
4 77 57
6 71 51
8 66 46
10 61 41
12 57 37
15 52 32

A scatter plot of T against t suggests an exponentially decaying trend, with the rate of cooling gradually slowing as the coffee approaches room temperature. The relationship is clearly non-linear, so a transformation is needed before we can apply linear regression techniques.

T 对 t 的散点图显示出指数衰减趋势,冷却速率随着咖啡接近室温而逐渐放缓。这种关系显然是非线性的,因此在应用线性回归技术之前需要进行变换。


3. Underlying Assumptions of Newton’s Law of Cooling | 牛顿冷却定律的基本假设

We adopt Newton’s Law of Cooling, which states that the rate of change of temperature of an object is proportional to the difference between its own temperature and the ambient temperature. For constant ambient temperature Ta = 20 deg C, this leads to the differential equation dT/dt = -k (T – 20), where k > 0 is a cooling constant. Solving this yields the exponential model T = 20 + (T0 – 20) e-kt, where T0 is the initial temperature at t = 0.

我们采用牛顿冷却定律,该定律指出物体温度的变化速率与其自身温度和环境温度之差成正比。对于恒定的环境温度 Tₐ = 20 °C,可列出微分方程 dT/dt = -k (T – 20),其中 k > 0 是冷却常数。解此方程得到指数模型 T = 20 + (T₀ – 20) e⁻ᵏᵗ,其中 T₀ 为 t = 0 时的初始温度。

The model assumes that the room temperature stays exactly constant, the coffee is well-stirred so that its temperature is uniform, and heat loss occurs only through convection and radiation described by a single effective constant k. These idealised assumptions will later be scrutinised using residuals.

该模型假设室温保持完全恒定,咖啡已充分搅拌使其温度均匀,且热量损失仅通过与单一有效常数 k 相关的对流和辐射进行。这些理想化假设稍后将通过残差加以审视。


4. Linearising the Exponential Model | 指数模型线性化

To use linear least-squares regression, we transform the model into a linear form. Let y = ln(T – 20). Then y = ln(T0 – 20) – k t. This is of the form y = a + b t, with intercept a = ln(T0 – 20) and gradient b = -k. We can now calculate y for each data point and perform a linear regression of y on t.

为了利用线性最小二乘回归,我们将模型转化为线性形式。令 y = ln(T – 20)。则 y = ln(T₀ – 20) – k t,其形式为 y = a + b t,其中截距 a = ln(T₀ – 20),斜率 b = -k。现在可以计算每个数据点的 y 值,并对 y 关于 t 进行线性回归。

Using the values of T – 20 from the table, we obtain the following y-values (rounded to four decimal places): at t=0, y=ln72=4.2767; t=2, 4.1589; t=4, 4.0431; t=6, 3.9318; t=8, 3.8286; t=10, 3.7136; t=12, 3.6109; t=15, 3.4657. The transformed data now appear roughly linear.

利用表中 T – 20 的值,我们得到下列 y 值(四舍五入至四位小数):t=0 时 y=ln72=4.2767;t=2 时 4.1589;t=4 时 4.0431;t=6 时 3.9318;t=8 时 3.8286;t=10 时 3.7136;t=12 时 3.6109;t=15 时 3.4657。变换后的数据大致呈线性。


5. Calculating the Regression Line | 计算回归直线

Let t be the independent variable x, and y be the dependent variable. We compute the following sums for the n = 8 data points:

令 t 为自变量 x,y 为因变量。对于 n = 8 个数据点,计算下列求和项:

  • Sigma x = 0 + 2 + 4 + 6 + 8 + 10 + 12 + 15 = 57
  • Sigma y = 4.2767 + 4.1589 + 4.0431 + 3.9318 + 3.8286 + 3.7136 + 3.6109 + 3.4657 = 31.0293
  • Sigma xy = 0*4.2767 + 2*4.1589 + … + 15*3.4657 = 211.1621
  • Sigma x² = 0² + 2² + 4² + 6² + 8² + 10² + 12² + 15² = 589

The slope b is estimated by b = (n Sigma xy – Sigma x Sigma y) / (n Sigma x² – (Sigma x)²). Substituting the numbers: numerator = 8*211.1621 – 57*31.0293 = 1689.2968 – 1768.6701 = -79.3733; denominator = 8*589 – 57² = 4712 – 3249 = 1463. Thus b = -79.3733 / 1463 = -0.05425 (to 5 d.p.).

斜率 b 的估计值为 b = (n Σxy – Σx Σy) / (n Σx² – (Σx)²)。代入数值:分子 = 8×211.1621 – 57×31.0293 = 1689.2968 – 1768.6701 = -79.3733;分母 = 8×589 – 57² = 4712 – 3249 = 1463。因此 b = -79.3733 / 1463 = -0.05425(保留五位小数)。

The intercept a = mean(y) – b * mean(x). Mean of x = 57/8 = 7.125; mean of y = 31.0293/8 = 3.8786625. Hence a = 3.8786625 – (-0.05425*7.125) = 3.8786625 + 0.38653125 = 4.2652 (to 4 d.p.). The regression equation is therefore:

截距 a = ȳ – b x̄。x 的平均值 = 57/8 = 7.125;y 的平均值 = 31.0293/8 = 3.8786625。于是 a = 3.8786625 – (-0.05425×7.125) = 3.8786625 + 0.38653125 = 4.2652(四位小数)。因此回归方程为:

ln(T – 20) = 4.2652 – 0.05425 t


6. Interpreting the Parameters | 参数解释

From a = 4.2652 we recover an estimate of the initial excess temperature: T0 – 20 = e4.2652 approx 71.2 deg C, giving T0 approx 91.2 deg C. This is remarkably close to the observed 92 deg C, supporting the model’s internal consistency. The cooling constant k = -b = 0.05425 min-1, meaning the excess temperature decays exponentially at a rate of about 5.4% per minute initially.

由 a = 4.2652 我们反推出初始超出温度的估计值:T₀ – 20 = e⁴·²⁶⁵² ≈ 71.2 °C,因此 T₀ ≈ 91.2 °C。这与观察到的 92 °C 非常接近,支持了模型的内部一致性。冷却常数 k = -b = 0.05425 min⁻¹,意味着初始时超出温度以每分钟大约 5.4% 的速率指数衰减。

The equation can be written in the original variable form: T = 20 + 71.2 e-0.05425 t. While the parameter estimates are empirical, they are physically meaningful: k depends on the thermal properties of the cup, the coffee, and the surrounding air.

该方程可写为原始变量形式:T = 20 + 71.2 e⁻⁰·⁰⁵⁴²⁵ ᵗ。虽然参数估计是经验性的,但它们具有物理意义:k 取决于杯子、咖啡和周围空气的热力学性质。


7. Measuring Goodness-of-Fit | 评估拟合优度

A key statistic is the Pearson correlation coefficient r for the transformed data. We compute SSxy = Sigma xy – (Sigma x Sigma y)/n = 211.1621 – (57*31.0293)/8 = 211.1621 – 221.08376 = -9.92166. SSxx = 589 – 57²/8 = 182.875. SSyy = Sigma y² – (Sigma y)²/n. First, Sigma y² = 4.2767² + … + 3.4657² approx 120.891. Then SSyy = 120.891 – (31.0293)²/8 = 120.891 – 120.352 = 0.539. The correlation coefficient r = SSxy / sqrt(SSxx * SSyy) = -9.92166 / sqrt(182.875 * 0.539) = -9.92166 / 9.928 = -0.9994. This is extremely close to -1, indicating an almost perfect linear relationship between ln(T – 20) and t, and thus an excellent exponential fit to the original data.

一个关键的统计量是变换后数据的皮尔逊相关系数 r。计算 SSₓᵧ = Σxy – (Σx Σy)/n = 211.1621 – (57×31.0293)/8 = 211.1621 – 221.08376 = -9.92166。SSₓₓ = 589 – 57²/8 = 182.875。SSᵧᵧ = Σy² – (Σy)²/n。首先 Σy² = 4.2767² + … + 3.4657² ≈ 120.891。则 SSᵧᵧ = 120.891 – (31.0293)²/8 = 120.891 – 120.352 = 0.539。相关系数 r = SSₓᵧ / √(SSₓₓ × SSᵧᵧ) = -9.92166 / √(182.875 × 0.539) = -9.92166 / 9.928 = -0.9994。该值极为接近 -1,表明 ln(T – 20) 与 t 之间存在近乎完美的线性关系,因此原始数据的指数拟合非常出色。

The coefficient of determination R² = r² = 0.9988, meaning 99.88% of the variation in ln(T – 20) is explained by the linear model in t. Such a high value usually confirms the model’s validity for the observed range.

决定系数 R² = r² = 0.9988,意味着 ln(T – 20) 中 99.88% 的变异可由关于 t 的线性模型解释。如此高的数值通常证实了模型在观测范围内的有效性。


8. Residual Analysis | 残差分析

To check for any systematic patterns, we compute the residuals e = observed y – predicted y. Using the regression line, the predicted y values are: for t=0, 4.2652; t=2, 4.2652 -0.1085 = 4.1567; t=4, 4.0482; t=6, 3.9397; t=8, 3.8312; t=10, 3.7227; t=12, 3.6142; t=15, 3.4515. The corresponding residuals are: 0.0115, 0.0022, -0.0051, -0.0079, -0.0026, -0.0091, -0.0033, 0.0142. All residuals are very small in magnitude and show no obvious trend when plotted against t, supporting the assumption of random errors.

为检查是否存在系统模式,我们计算残差 e = 观测 y – 预测 y。利用回归直线,预测的 y 值为:t=0 时 4.2652;t=2 时 4.2652 -0.1085 = 4.1567;t=4 时 4.0482;t=6 时 3.9397;t=8 时 3.8312;t=10 时 3.7227;t=12 时 3.6142;t=15 时 3.4515。相应的残差为:0.0115, 0.0022, -0.0051, -0.0079, -0.0026, -0.0091, -0.0033, 0.0142。所有残差的值都很小,且对 t 作图时无明显趋势,这支持了随机误差的假设。

A residual plot helps identify curvature or heteroscedasticity. Here the points scatter randomly around zero, which confirms that the linearised model is appropriate. However, the slightly larger residual at t=15 might hint at early departure from the idealised law as the temperature difference becomes small, but with only eight points this remains inconclusive.

残差图有助于识别弯曲或异方差性。本例中数据点随机散布在零附近,证实了线性化模型的适当性。不过,t=15 时稍大的残差可能暗示当温差变小时模型开始偏离理想定律,但由于仅有八个数据点,这仍无法定论。


9. Making Predictions | 进行预测

We can now use the model to estimate the coffee temperature at t = 20 minutes. Substitute t = 20 into the linear regression: ln(T – 20) = 4.2652 – 0.05425*20 = 4.2652 – 1.085 = 3.1802. Hence T – 20 = e3.1802 approx 24.05, giving T approx 44.0 deg C (1 d.p.). The model predicts a temperature of about 44 deg C after 20 minutes of cooling.

现在我们可以利用模型估计 t = 20 分钟时的咖啡温度。将 t = 20 代入线性回归:ln(T – 20) = 4.2652 – 0.05425×20 = 4.2652 – 1.085 = 3.1802。于是 T – 20 = e³·¹⁸⁰² ≈ 24.05,得出 T ≈ 44.0 °C(保留一位小数)。模型预测冷却 20 分钟后的温度约为 44 °C。

This is an extrapolation beyond the data range (t > 15), so caution is needed. The linear relationship between ln(T – 20) and t may not hold indefinitely. In reality, factors such as evaporation, changes in air currents, or the cup’s heat capacity could become significant at lower temperature differences, causing the actual temperature to deviate from the exponential curve.

这是超出数据范围(t > 15)的外推,因此需要谨慎。ln(T – 20) 与 t 之间的线性关系可能不会无限期成立。现实中,蒸发、气流变化或杯子的热容等因素在温差较低时可能变得显著,导致实际温度偏离指数曲线。


10. Limitations and Further Refinements | 局限性与改进

The simple Newton cooling model relies on several assumptions: constant ambient temperature, negligible thermal gradient inside the coffee, and a single overall heat transfer coefficient k. In a real experiment, room temperature may fluctuate, the coffee may stratify unless stirred, and radiative heat loss may not be exactly proportional to T – 20. Additionally, the transformation ln(T – 20) amplifies measurement errors for small (T – 20), impacting the reliability of the tail of the data.

简单的牛顿冷却模型依赖于若干

Published by TutorHao | Pre-U Mathematics Revision Series | aleveler.com

更多咨询请联系16621398022(同微信)

Comments

屏轩国际教育cambridge primary/secondary checkpoint, cat4, ukiset,ukcat,igcse,alevel,PAT,STEP,MAT, ibdp,ap,ssat,sat,sat2课程辅导,国外大学本科硕士研究生博士课程论文辅导

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from aleveler.com

Subscribe now to keep reading and get access to the full archive.

Continue reading