0

I have a dataset which resembles the following:

time <- c(0, 10, 20, 30, 40, 50, 60, 70 , 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190)
temp <- c(30, 28, 24, 20, 17, 13, 10, 9, 8, 7.5, 7, 6.5, 6, 5.8, 5.5, 5.3, 5.1, 5, 5, 5)

Ts = 5 # ambient temperature of surroundings
T0 = 30 # start temperature

plot(temp, time)

enter image description here

Using Newton's law of cooling, where Temp(time) ~ Ts + (T0)exp^-c*time I am trying to fit an exponential model in R to work out the value of c (i.e., the cooling rate).

From other questions on here, I feel that using nls() would be appropriate, but I am unsure how to set up the model given that I don't know the value of c. Any advice would be appreciated.

  • eyeball it: use starting values of `Ts`=25, `T0=5`. Half-life is about 30 time units, so `c` is approx 0.7/30 ~ 0.023. That should be good enough. (Can you say a little more about which other answers you've looked at and how you've tried to use them?) (FWIW, the initial phase looks like it might be non-exponential ...) – Ben Bolker Sep 23 '20 at 22:11
  • PS the first half of the `muscle` example in `?nls` is exactly your model ... – Ben Bolker Sep 23 '20 at 22:14

0 Answers0