Appendix
C.
Solutions
to
odd-numbered exercises
529
(b)
If the
initial populations
are
x(0)
= r,
y(0)
= s,
then
the
solution
to the
IVP
is
Therefore,
if r = s,
both populations decay
to
zero exponentially;
that
is,
both
species
die
out.
Section
4.4
1. (a)
Four
steps
of
Euler's method yield
an
estimate
of
0.71969.
(b)
Two
steps
of the
improved
Euler
method yield
an
estimate
of
0.80687.
(c)
One
step
of the RK4
method yields
an
estimate
of
0.82380.
Euler's method gives
no
correct digits,
the
improved Euler method gives
one
correct
digit,
and RK4
gives three correct digits. Each
of the
methods evaluated
f(t,
u)
four
times.
(b)
The
routine
ode45
from
MATLAB
(version 5.3) required
421
steps
to
produce
a
graph with
the
ending point apparently coinciding with
the
initial value.
The
graph
of
y(t) versus x(t)
is
given
in
Figure
C.4.
The
graphs
of
x(t)
and
y(t),
together with
the
times steps,
are
given
in
Figure
C.5.
They show,
not
surprisingly,
that
the
time step
is
forced
to be
small precisely when
the
coordinates
are
changing rapidly.
(c)
The
minimum step size taken
by
ode45
was
3.28
•
10~
4
,
and
using this step
length over
the
entire interval
of [0,
T]
would require almost 19000
steps.
This
is
to be
compared
to the 421
steps taken
by the
adaptive algorithm. (Note:
The
exact results
for
minimum step size, etc.,
will
differ
according
to the
algorithm
and
tolerances
used.)
5.
(a) We first
note
that
a+(ti—
to)
<
t
<
b+(ti
—
to)
if
and
only
if
a
<
t—(t\
—
to)
<b,
so
the
function
v is
well-defined.
In
fact,
(just
replace
t —
(ti
—
to) by t in the
last
step).
Appendix
C.
Solutions
to
odd-numbered exercises 529
(b)
If
the
initial populations are
x(O)
=
r,
yeO)
= s,
then
the
solution
to
the
IVP
is
x(t)
=
~
(r
+
s)e-
t
+ (r - s)e
3t
) , yet) =
~
((r +
s)e-
t
+ (s - r)e
3t
) .
Therefore, if r =
s,
both
populations decay
to
zero exponentially;
that
is,
both
species die out.
Section 4.4
1. (a) Four steps of Euler's
method
yield
an
estimate of 0.71969.
(b) Two steps of
the
improved Euler
method
yield an
estimate
of 0.80687.
(c) One step
of
the
RK4
method
yields an estimate of 0.82380.
Euler's
method
gives no correct digits,
the
improved Euler
method
gives one correct
digit,
and
RK4 gives three correct digits. Each of
the
methods evaluated
f(t,
u) four
times.
3.
(a) Let
Ul
=
X,
U2
=
dx/dt,
U3
= y,
U4
= dy/dt.
Then
the
system is
dUl
dt
=U2,
duz _
Ul
+
2U4
_
1-'2(Ul
+
I-'d
_
1-'1(Ul
-
1-'2)
dt -
rl
(Ul,
U3)3
r2(
Ul,
U3)3
'
dU3
dt
=U4,
dU4
I-'zU3
- = -
2U2
+
U3
-
----:'-------'----::-::-
dt
rl(Ul,U3)3
(b)
The
routine
ode45
from MATLAB (version 5.3) required
421
steps
to
produce
a graph with
the
ending point apparently coinciding with
the
initial value.
The
graph of yet) versus
x(t)
is given in Figure C.4.
The
graphs of x(t)
and
yet), together with
the
times steps, are given in Figure
C.5.
They
show,
not surprisingly,
that
the
time step is forced
to
be small precisely when
the
coordinates are changing rapidly.
(c)
The
minimum step size taken by
ode45
was
3.28.10-
4
,
and
using this step
length over
the
entire interval of
[0,
T] would require almost 19000 steps. This
is
to
be
compared
to
the
421
steps taken by
the
adaptive algorithm. (Note:
The
exact results for minimum step size, etc., will differ according
to
the
algorithm
and
tolerances used.)
5.
(a)
We
first note
that
a+(tl-tO)
S t S b+(lI
-to)
if
and
only if
as
t-(lI
-to)
S
b,
so
the
function v is well-defined.
In
fact,
{vet) : t E
[a
+ (lI - to), b + (tl - to)]}
={u(t-(lI-to)):
tE[a+(h-to),b+(lI-to)]}
= {u(t) : t E
[a,b]}
Gust replace t - (tl - to) by t in
the
last step).