Uploaded by jackgettys11

inclassexercise

advertisement
In Class Exercise
clear;
dTdt = @(t, T) (170 - T)/10
dTdt = function_handle with value:
@(t,T)(170-T)/10
v0 = 70
v0 = 70
tspan = [0, 100]
tspan = 1×2
0
100
[t, T] = ode45(dTdt, tspan, v0)
t = 49×1
0
0.3517
0.7033
1.0550
1.4067
3.1650
4.9233
6.6816
8.4399
10.5737
T = 49×1
70.0000
73.4555
76.7916
80.0125
83.1220
97.1392
108.8932
118.7391
126.9968
135.2725
plot(t, T)
xlabel("time")
ylabel("temperature (deg F)")
ylim([70, 180])
1
2
Download