MA124: Maths by Computer - Week 5: Thomas Dove and Kyle Byrne February 8, 2015
MA124: Maths by Computer - Week 5: Thomas Dove and Kyle Byrne February 8, 2015
1
1.1
6A
(a)
The temperature T (t) at time t of a dead body lying outside satisfies the equation
dT
= k(T (t) A(t))
(1)
dt
where k is an unknown rate of cooling. A(t) ,the fluctuation of outside temperature, is given by
A(t) = 3 5 cos((t 2))
where = 12
and t is the time of day measured in hours, with t = 0 corresponding to midnight. We can rearrange (1) into the form of a inhomogeneous
first order differential equation as follows:
dT
+ kT = 3k 5k cos((t 2))
dt
(2)
5k
( sin((t 2)) + k cos((t 2)))
k2 + 2
(3)
5k
( sin(5) + k cos(5))
k2 + 2
(4)
And so our particular solution for the temperature of the body at a given time
(t) past midnight is:
T (t) = 3 + (e7k (17 +
k2
5k
( sin(5) + k cos(5)))ekt
k2 + 2
5k
( sin((t 2)) + k cos((t 2)))
+ 2
(5)
1.2
(b)
We now get given that at 8 a.m (t = 8) that the temperature of the body has
dropped to 15 degrees, that is T (8) = 15. By substituting these conditions into
(5), we can rearrange to find a formula for k.
15 = 3 + (e7k (17 +
12 +
k2
k2
5k
( sin(6) + k cos(6)))
+ 2
5k
5k
( sin(6) + k cos(6)) = ek (17 + 2
( sin(5) + k cos(5))
k2 + 2
k + 2
ek =
17 +
12 +
5k
k2 + 2 ( sin(5) + k cos(5)
5k
k2 + 2 ( sin(6) + k cos(6))
And so:
k = log
1.3
5k
( sin(5) + k cos(5)))e8k
+ 2
17 +
12 +
5k
k2 + 2 ( sin(5) + k cos(5)
5k
k2 + 2 ( sin(6) + k cos(6))
(6)
(c)
Using Matlab, we are able to use the fixed-point iteration method to approximate a value of k with an error of less than 104 of the actual rate of cooling
of the body.
By taking our initial guess for k to be 1, we approximate the value of k to be
0.3339, with an error less than 104 .
1.4
(d)
With an estimate for the rate of cooling, we can now use (5), to gather an approximate time of death. It is known that at the time of death, the temperature
of body would of been around 37 degrees. Hence by using the plotted function
of T (t), we can find a corresponding time for which the bodies temperature was
at 37 degrees, and so from this we can find the time of death.
Using the function (5), by solving for time, we found for a temperature T = 37,
the time corresponding to that temperature was t = 5.1083.
This value for t, shows us the time of death was approximately 5:06 a.m.
2
2.1
6B
(a)
J(t) =
X
(1)k (t/2)2k
(k!)2
k=0
(7)
where ak = (t/2)
(k!)2 . As (ak ) is decreasing and null, by the ratio test, we can
determine that J(t) is convergent by the alternating series test.
The Bessel Function can also be shown to satisfy the differential equation:
tJ 00 (t) + J 0 (t) + tJ(t) = 0;
f or t R
(8)
By calculating the first and second derivative of J(t), we can then substitute
this into the differential equation to show it holds true.
0
J (t) =
X
(1)k k(t/2)2k1
(k!)2
k=1
X
(1)k (t/2)2k1
k!(k 1)!
k=1
(9)
J 00 (t) =
X
(1)k (t/2)2k2
k=1
k=0
((k 1)!)2
k
1 X (1)k (t/2)2k2
2
k!(k 1)!
k=1
(1) (t/2)
((k)!)2
2k
1 X (1)k (t/2)2k2
k=1
k!(k 1)!
(10)
X
X
1 X (1)k (t/2)2k2 X (1)k (t/2)2k1
(1)k (t/2)2k
(1)k (t/2)2k
t
+
+
t
= t
((k)!)2
2
k!(k 1)!
k!(k 1)!
(k!)2
k=0
1
= t
2
=
k=1
2k2
(1) (t/2)
k!(k 1)!
X
(1)k (t/2)2k1
k=1
k!(k 1)!
k=1
k=1
k=1
k=0
2k1
(1) (t/2)
k!(k 1)!
X
(1)k (t/2)2k1
k=1
k!(k 1)!
=0
The difficulty of plotting the power series over the solution to the differential
equation is that plotting a series from zero to infinity over many values of t (for
accurate plot, the number of values of time to be plotted would be in excess of
500 values), and there to plot the function accurately would require a immense
amount of computation.
2.2
(b)
(11)
(12)
y2 (t) = J
4
and by using these, we can recast (8) into two first order differential equations.
By differentiating (11) with respect to time:
y10 (t) = J 0
which by substituting for (12), we get:
y10 (t) = y2 (t)
(13)
(14)
So we now have a system of first order differential equations, (13) and (14) ,
which can be plotted using the ode45 function in Matlab.
The initial conditions for J(t) and J 0 (t) (equivalent to y1 (t) and y2 (t) respectively) can be found using the Bessel Function (7) and using it to calculate the
values for J(t) and J 0 (t) at a time t = 0, giving us both initial conditions for
y1 (t) and y2 (t).
X
(1)k (0)2k
y1 (0) = J(0) =
=1
(k!)2
k=0
y2 (0) = J 0 (0) =
X
(1)k (0)2k1
k=1
k!(k 1)!
=0
However the issue with starting from t = 0 when solving the differential equation
using Matlab, is that in (14) the coefficient for y2 (t) is 1t , and hence at t = 0
this would make the differential equation (14) undefined. So the system of
differential equations would be only be solvable using Matlabs ode45 function
if the time t = 0 was not included.
2.3
(c)
By using Matlab, we can calculate the values of J(t) and J 0 (t) at a time t = 1,
to an error less than 104 , by using the Bessel function and its first derivative.
The values attained are as follows:
J(1) = 0.765198
J 0 (1) = 0.440050
both having an error less than 104 away from the true values for J(1) and
J 0 (1).
2.4
(d)
Using the values for J(1) and J 0 (1) in (c), we can use them as initial conditions,
and plot the function J(t) over the interval t [1, 50].
Figure 4: Plot of t0.5 cos (t) (C = 1, = 0.5, = 0) (Red) against J(t) (Blue),
over the interval t [1, 50].