Parameter calculation

> dataplot := plot(pts(times, data), style=point, symbol=point, color=black):

> ambientTemp := 19.7:

> TempDif := map(x-> ambientTemp-x, data):

> data_dd := dd(times, data):


Relative divided simple difference

> relative_dd := zip((x,y)->x/y, data_dd, TempDif):

> a := mean(relative_dd);

a := .2348076982e-3

> N := 50:
params := M=ambientTemp, alpha=a, t_0=times[N], T_0=data[N];
model_rdd := subs(params, Newton);
display([dataplot,
plot([model_rdd, ambient], t=0..720*25, 0..72,
color=[blue, grey])]);

params := M = 19.7, alpha = .2348076982e-3, t_0 = 1...

model_rdd := 19.7+29.85*exp(-.2348076982e-3*t+.2876...

[Maple Plot]


Relative divided centered difference,

> data_cd := cd(times, data):
cdd := zip((x,y)->x/y, data_cd, TempDif):
b := mean(cdd);

b := .2761515694e-3

> N := 50:
params := M=ambientTemp, alpha=b, t_0=times[N], T_0=data[N];
model_cdd := subs(params, Newton);
display([dataplot,
plot([model_cdd,ambient], t=0..720*25, 0..72,
color=[blue,grey])]);

params := M = 19.7, alpha = .2761515694e-3, t_0 = 1...

model_cdd := 19.7+29.85*exp(-.2761515694e-3*t+.3382...

[Maple Plot]


Relative divided higher order difference

> data_hd := hd(times, data):
hdd := zip((x,y)->x/y, data_hd, TempDif):
c := mean(hdd);

c := .3200881574e-3

> N := 50:
params := M=ambientTemp, alpha=c, t_0=times[N], T_0=data[N];
model_hdd := subs(params, Newton);
display([dataplot,
plot([model_hdd,ambient], t=0..720*25, 0..72,
color=[blue,grey])]);

params := M = 19.7, alpha = .3200881574e-3, t_0 = 1...

model_hdd := 19.7+29.85*exp(-.3200881574e-3*t+.3921...

[Maple Plot]

> model_rdd;
model_cdd;
model_hdd;

19.7+29.85*exp(-.2348076982e-3*t+.2876394303)

19.7+29.85*exp(-.2761515694e-3*t+.3382856725)

19.7+29.85*exp(-.3200881574e-3*t+.3921079928)

> plot([model_hdd, model_cdd, model_rdd, pts(times, data)], t=0..720*25, color=[grey,red,blue,green], legend=["data", "high order", "central", "simple"]);

[Maple Plot]

>