Beruflich Dokumente
Kultur Dokumente
(t
0
) = lim
h0
y(t
0
+ h) y(t
0
)
h
.
Since y
(t
0
) = f(t
0
, y(t
0
)) then
f(t
0
, y(t
0
)) = lim
h0
y(t
0
+ h) y(t
0
)
h
.
One way of deriving Eulers method comes about by considering the quotient
in this limit to be a good approximation when h is small, that is
f(t
0
, y(t
0
))
y(t
0
+ h) y(t
0
)
h
. (2)
1
Eulers method is derived from Equation (2) by asserting equality in this
approximation and replacing y(t
0
+ h) with the approximation y
(t
0
+ h).
That is,
f(t
0
, y(t
0
)) =
y
(t
0
+ h) y(t
0
)
h
.
Rearranging terms yields the relation
y
(t
0
+ h) = y(t
0
) + hf(t
0
, y(t
0
)) (3)
This is Eulers method approximation to the solution value y(t
0
+ h). (See
Figure 29.1). By letting t
1
= t
0
+h and y
1
= y
(t
1
) the last equation can be
written in the form
y
1
= y
0
+ (t
1
t
0
)f(t
0
, y
0
).
Figure 29.1
Next, we would like to proceed in a similar manner, but we dont have the
value of the solution at t
1
and so we wont know the slope of the tangent
line to the solution at this point. However, since we assumed that y
1
is a
good approximation to y(t
1
) then we can use that to estimate the slope of
the tangent line at t
1
and construct a line through the point (t
1
, y
1
) that has
slope f(t
1
, y
1
). This gives
y = y
1
+ (t t
1
)f(t
1
, y
1
).
Now, to get an approximation to the solution at t = t
2
we will hope that this
new line will be fairly close to the actual solution at t
2
and use the value of
the line at t
2
as an approximation to the actual solution. This gives.
y
2
= y
1
+ (t
2
t
1
)f(t
1
, y
1
).
2
We can continue in this fashion. Use the previously computed approximation
to get the next approximation. So,
y
3
= y
2
+ (t
3
t
2
)f(t
2
, y
2
)
y
4
= y
3
+ (t
4
t
3
)f(t
3
, y
3
)
.
.
.
In general, if we have t
n
and the approximation to the solution at this point,
y
n
, and we want to nd the approximation at t
n+1
all we need to do is use
the following
y
n+1
= y
n
+ (t
n+1
t
n
)f(t
n
, y
n
). (4)
Equation (4) is known as Eulers method.
When implementing Eulers method, we will assume that the step sizes be-
tween the points t
0
, t
1
, t
2
, to a uniform size of h. In other words, we will
often assume that
t
n+1
t
n
= h.
In this case, Equation (4) can be written as
y
n+1
= y
n
+ hf(t
n
, y
n
).
We illustrate Eulers method in the next example.
Example 29.1
Suppose that y(0) = 1 and
dy
dt
= y. Estimate y(0.5) in 5 steps using Eulers
method.
Solution.
The step size is h =
0.50
5
= 0.1. The following chart lists the steps needed:
k t
k
y
k
f(t
k
, y
k
)h
0 0 1 0.1
1 0.1 1.1 0.11
2 0.2 1.21 0.121
3 0.3 1.331 0.1331
4 0.4 1.4641 0.14641
5 0.5 1.61051
Thus, y(0.5) 1.61051. Note that the exact value is y(0.5) = e
0.5
= 1.6487213
3
Figure 29.2
Example 29.2
An investor has a savings account that pays 3.5% interest. The investor
opens the account with $500 and makes an additional deposit of $500 at the
end of each year. Assume the function S(t), which gives the amount in the
savings account after t years, satises the initial value problem
dS
dt
= 0.035S + 500, S(0) = 500.
Use Eulers method to estimate the amount in the account at the end of one
year, using a step size of 0.1.
Solution.
The following chart lists the steps needed:
k t
k
S
k
f(t
k
, S
k
)h
0 0 500 51.75
1 0.1 551.75 51.93
2 0.2 603.68 52.11
3 0.3 655.79 52.30
4 0.4 708.09 52.48
5 0.5 760.57 52.66
6 0.6 813.23 52.85
7 0.7 866.08 53.03
8 0.8 919.11 53.22
9 0.9 972.33 53.40
10 1.0 1025.73
Thus, S(1) $1025.73
Remark 29.1
1. Eulers method approximates the value of the solution at a given point; it
4
does not give an explicit formula of the solution.
2. It can be shown that the error in Eulers method is proportional to
1
n
.
Thus, doubling the number of mesh points will decrease the error by
1
2
.
5