Вы находитесь на странице: 1из 6

Euler's Method

http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/mordifeqs/euler.html

Limited and Unlimited Growth The HIV Epidemic in Vancouver's Lower East Side UBC Calculus Online Course Notes

Euler's Method
We have seen how to use a direction field to obtain qualitative information about the solutions to a differential equation. This simple kind of reasoning lead to predictions for the eventual behaviour of solutions to the logistic equation. Sometimes, however, we want more detailed information. For instance, we might want to know how long it will take before the solution is near the limiting value. In this case, we can use the linear approximation to numerically approximate solutions to differential equations. We will demonstrate this approach through an example.

A Simple Initial Value Problem Let's start by looking at an initial value problem whose solution is known:

We know that the solution is . This means that after we find our approximate solution, we will be able to determine how good of an approximation it really is. Let's suppose that we are interested in the value of the solution at . We know the value at since that is a part of the initial value problem---namely, . Notice that the differential equation also tells us the derivative of the solution at since

If we now form the linear approximation at , we find that . Then our approximation yields

This approximation is not too good but it was easy to obtain. Graphically, the picture is like this:

1 of 6

7/7/2012 12:27 PM

Euler's Method

http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/mordifeqs/euler.html

The problem with the approximation is that the derivative of the solution is changing across the interval but the approximation assumes that it is constantly 1 . We can try to fix this up by diving the interval into two pieces: First, we will use the linear approximation based at to approximate the value at . Then we will use a linear approximation at to obtain an approximate value at based at . This tells us that the . That means that . .

We have already obtained the linear approximation This produces the approximate value solution curve approximately passes through

We will then form the linear approximation at the point

: it produces

which yields the approximation approximation to the value is illustrated in the diagram.

. This is, in fact, a better . Graphically, what we have done

2 of 6

7/7/2012 12:27 PM

Euler's Method

http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/mordifeqs/euler.html

Here you can see why we have a better approximation: the derivative of the solution changes as we move across the interval . In the second approximation, we take this into account by stopping at , recomputing the derivative and then continuing on. Now you can probably imagine that we will get better approximations if we take shorter steps and correct the slope at every step. To do this, imagine walking from 0 to 1 by taking n steps, each of width . We will call the points we obtain .

3 of 6

7/7/2012 12:27 PM

Euler's Method

http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/mordifeqs/euler.html

Notice that since this is where the initial value problem tells us to begin. To get from one step to the next, we are assuming that the solution approximately passes through . At that point, the derivative, which is equal to the y coordinate by the differential equation, is . That means that the linear approximation at that point is

This means that at

, we have

The following demonstration will let you select the number of steps and show you the approximate solution (type in the number of steps and press "Return"). Notice that as the number of steps gets larger, the approximation becomes very good.

4 of 6

7/7/2012 12:27 PM

Euler's Method

http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/mordifeqs/euler.html

Euler's Method Now we will work with a general initial value problem

We will again form an approximate solution by taking lots of little steps. We will call the distance between the steps h and the various points . To get from one step to the next, we will form the linear approximation at . The derivative at this point is given by the differential equation: . The linear approximation is then

so that

This technique is called Euler's Method.

5 of 6

7/7/2012 12:27 PM

Euler's Method

http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/mordifeqs/euler.html

The logistic equation Now we will consider the initial value problem

Notice that this has the basic form of the logistic equation. We have studied this equation qualitatively, but we do not explicitly know solutions. As an example, we will approximate the solution on the interval by taking steps of width h. Applying Euler's Method, we can generate an approximate solution by

In the demonstration below, you can enter the number of steps and see the approximate solution. Again, as you take more steps, the solution does not vary too much when you increase the number of steps. You can then feel confident that your solution is a good approximation.

6 of 6

7/7/2012 12:27 PM

Вам также может понравиться