Unformatted text preview:

MIT OpenCourseWarehttp://ocw.mit.edu 18.034 Honors Differential Equations Spring 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.LIMITATIONS OF EULER’S METHOD FOR NUMERICAL INTEGRATION LAURA EVANS. 1. Introduction Not all differential equations can be explicitly solved for y. This can be problematic if we need to know the value of y at a specific point. This is where methods of numerical integration are useful, as they allow us to estimate the value of y based on known initial conditions. One of these methods for numerical integration is Euler’s Method, which will be the subject of the following discussion. Although not the most accurate of methods, it is one of the simplest, which is useful when beginning to understand these methods. Essentially, the method works by finding the slope at a known, traveling in a small amount h in that direc tion, then calculating the new slope and traveling in the direction of the new slope, and so on. Euler’s method is an iterative method. Consider the initial value problem y�(x) = f(x, y(x))(1) y(a) = y0 We proceed in steps of size h, so x0 = a and xn+1 = xn + h. For each step, then, yn+1 = yn + hf(xn, yn) This allows us to approximate the value of y at a point x, given the initial data. Because of its relative simplicity as a numerical method, Euler’s method is limited in its scope, as I will discuss in this paper1 . 2. Error Proposition 2.1. Euler’s method produces an answer with accuracy o(h). Date: May 18, 2007. 1This discussion is based on material found on Section 1.8 of Birkhoff Rota, with some inspiration for examples drawn from the Wikipedia entry on Euler’s Method. 12 LAURA EVANS. Proof. Consider the Taylor expansion of y(x) around a + h: y(a + h) = y(a) + hy�(a) + o(|h2|) But Euler’s method gives y(a + h) = y(a) + hy�(a) Since the error is the difference between the two equations, we can see that the error in this first step is o(|h2|). The way Euler’s method is commonly used is to set h equal to some small fraction of the difference between the desired value and the known value. Thus, the number of steps needed to reach the desired value is o(| 1 |), so the total error accumulated upon reaching the desired value h is o(|h|). � One consequence of this is that if we want an additional decimal place of accuracy in our answer, we must use a new h that is one-tenth the original. This means we must do a significantly more calculations. Thus, we see that Euler’s method is not efficient for finding answers to a high accuracy. 3. Demonstration Let us observe the behavior of solutions found using Euler’s method on the equation y� = ky, with initial value y(0) = 1 for various values of k < 0 We know that this equation has solution y(x) = xkt, so we can compare the values given by this method to the real values. First, we will consider k = −1. The true values and the values given by Euler’s method with h = 0.5 are given below. x yn y 0 1 1 0.5 0.5 0.61 1 0.25 0.37 Clearly, this is not very accurate. We can improve its accuracy, as we saw above, by decreasing the value of h. The following table shows the same function, with h = 0.13 LIMITATIONS OF EULER’S METHOD FOR NUMERICAL INTEGRATION x yn y 0 1 1 0.1 0.90 0.90 0.2 0.81 0.82 0.3 0.73 0.74 0.4 0.66 0.67 0.5 0.59 0.61 0.6 0.53 0.55 0.7 0.48 0.50 0.8 0.43 0.45 0.9 0.39 0.41 1 0.35 0.37 From this we see that the smaller value of h gives much more accurate values for y in our test case. In addition, we can see that the error does remain less than h, although it does increase as x increases. 4. Failure Now, let us consider the same equation as the previous section, but with larger values of |k|. In particular, we will look at k = −3, k = −11, and k = −21. First, we will use h = 0.5. Readers should note that all data in the following table is rounded to the second decimal place. x k = −3 k = −11 k = −21 yn y yn y yn y 0 0.5 1 1 0.70 0.49 1 0.22 0.05 1 -0.1 0.01 1 0 0 1 -1.1 1.21 1 0 0 The values for the first 2 k seem reasonable, but something seems off about the values that Euler’s method has given us for k = −21. Let’s decrease h to see if the problem goes away. Let’s set h equal to 0.1, as before. Again, values are rounded to the second decimal place.4 LAURA EVANS. x k = −3 k = −11 k = −21 yn y yn y yn y 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1 0.7 0.49 0.34 0.24 0.17 0.12 0.08 0.06 0.04 0.03 1 0.74 0.55 0.41 0.3 0.22 0.17 0.12 0.09 0.07 0.05 1 -.1 0.01 0 0 0 0 0 0 0 0 1 0.33 0.11 0.04 0.01 0 0 0 0 0 0 1 -1.1 1.21 -1.33 1.46 -1.61 1.77 -1.95 2.14 -2.36 2.59 1 0.12 0.01 0 0 0 0 0 0 0 0 From this, we can see that the problem has not gone away - in fact, it has gotten worse. Rather than approximating the curve, the values that Euler’s method gives for k = −21 oscillate around the curve, with growing amplitude. Holistically, it is easy to see what the problem is. When the method makes its ’step’ of length h, it assumes that y� will remain about constant over that small distance. However, this is not the case for y� = −21y. Over a distance h, y� changes relatively largely compared to h. The same is true whenever we have an equation of the form y� = ky, k � 0. We can expand this discussion to realize that whenever y� changes rapidly near y0, Euler’s method w ill not be accurate. Thus, use of Euler’s method should be limited to cases when max{|y��(x0±�)|} � ∞, for some neighborhood � near x0. 5. Improvements Euler’s method is a first order numerical approximation: each new value depends only on the value immediately before it. This is part of the reason that it can be affected as we saw previously. One way of improving Euler’s method is to use a second order ver-sion: y(a) = ya y1 = hf(a, y0) h yn+2 = yn + (f(xn, yn) + f(xn+1, yy+1))25 LIMITATIONS OF EULER’S METHOD FOR NUMERICAL INTEGRATION Let us consider what y2 is in this version. h y2 = y0 + (f(x0, y0) + f(x1, y1))2 h = ya + (y�(a) + f(h, hf(a, y0)))2 h = ya + (y�(a) + f(h, hy�(a)))2 h = ya + (y�(a) + y�(a) + hy��(a))2 h2 = ya + hy�(a) + y��(a)2 This is only o(h3) away from the second order Taylor expansion of y(x) near a. By …


View Full Document

MIT 18 034 - Euler's Method

Documents in this Course
Exam 3

Exam 3

9 pages

Exam 1

Exam 1

6 pages

Load more
Download Euler's Method
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Euler's Method and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Euler's Method 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?