Notebook to support Exercise 3.4.10, modeling a cooling potato.

The data, in time/temperature pairs:

data = {{0, 204}, {2, 193}, {4, 184}, {8, 169}, {10, 162}, {13, 156}, {17, 149}, {20, 143}, {24, 138}, {30, 130}}

The number of data points is

n = Length[data]

However, we will operate on the quantities (t, log(u(t)-A)-log(u(0)-A), with u(0)=204 and A = 72.

logdata = Table[{data[[j,1]],Log[data[[j,2]]-72]-Log[204-72]},{j,1,n}]

A plot:

plt1=ListPlot[logdata,AxesLabel->{"time (minutes)","Temperature"},PlotStyle->{Red}]

We seek to fit a line y = -k*t to this

u[t_] = -k*t

A least-squares function can be formed as

SS = Sum[(u[logdata[[j,1]]]-logdata[[j,2]])^2,{j,1,n}]

Now adjust k to minimize this.