Euler 1

advertisement
BC 1
Name:
Euler 1: Euler’s Method
Euler's Method is a process that allows us to start with a rate function y and use it to find a piecewiselinear approximation for the function y associated to this rate function.
If you travel at a constant rate, say 55 mph for 2 hours, then it is easy to calculate exactly how far you
have traveled during that time. Very simply, rate  time = distance. This works very nicely when the
rate is constant over an interval of time.
Now consider the rate function y' = x + 1 on [0, 6]. This function is pretty simple by mathematical
standards, yet it takes on a different y'-value for each value of x. Thus, this rate function is not constant
on any interval. So let's make an approximation of our y' that it is actually constant on some intervals.
For this example, we'll assume that y(0) = 0, and we'll choose a step size of x = 2, so that we have three
steps from x = 0 to x = 6. The step size determines the number of intervals over which our
approximation for y' will be constant as well as the length of each of these intervals. Choosing such a
large step size (relatively speaking) will give us a really lousy approximation for y' and thus for y, but it
will allow us to see the process more clearly.
7
In the first subinterval, [0, 2], we let y' = 1.
Where did this come from?
y (real)
6
5
4
In the second subinterval, [2, 4], we let
y' = 3. Where did this come from?
3
y (approx)
2
1
1
2
3
4
5
6
Generalize this to explain how the y' (approx)
graph was created from the y' (real) graph.
Starting at x = 0, use y' (approx) to find the value of y when x = 2.
From that location at x = 2, take another step and use y' (approx) to find the value of y when x = 4.
From the location at x = 4, take one more step and use y' (approx) to find the value of y when x = 6.
Euler 1.1
Rev. F11
As the previous example suggests, Euler's Method is simple at its heart. Basically, the approximation of
y is used to determine the endpoints of line segments that form the approximation for y. The y-values of
these endpoints are generated using the relationship new y = old y + ∆y, where ∆y = m · ∆x, or
ynew  yold  y  yold  m  x ,
where the values of m are taken from the graph of y (approx). This iterative process is repeated so that
the "new y" in one step becomes the "old y" in the subsequent step. Check that the following agrees
with the work from the previous page.
7
y (real)
6
5
4

3

yapprox
y (approx)
2
1 if 0  x  2

 3 if 2  x  4
5 if 4  x  6

1
1
2
3
4
5
6
Determining the endpoints of the segments that form the approximation for y (starting with y(0) = 0).
First step: 0  x  2
Second step: 2  x  4
Third step: 4  x  6
ynew  yold  m  x
ynew  yold  m  x
ynew  yold  m  x
 0  1 2
2
 2  3 2
8
 8  5 2
 18

yapprox
if 0  x  2
 x

  3 x  4 if 2  x  4
5 x  12 if 4  x  6

Note: The equations in the piecewise function yapprox were determined by finding the equations of the
lines passing through the endpoints of each of the three segments that form the graph of yapprox .
Euler 1.2
Rev. F11
Download