Mathematics

Euler's Method

Euler's Method is a numerical technique used to approximate the solutions of ordinary differential equations. It involves breaking down the differential equation into small steps and using the tangent line at each step to approximate the next value. While it is a simple and intuitive method, it may not always provide highly accurate results, especially for complex equations.

Written by Perlego with AI-assistance

9 Key excerpts on "Euler's Method"

  • Book cover image for: Elementary Differential Equations and Boundary Value Problems
    • William E. Boyce, Richard C. DiPrima, Douglas B. Meade(Authors)
    • 2021(Publication Date)
    • Wiley
      (Publisher)
    However, in all our discussions we assume that there is a unique solution of the initial value problem (1), (2) in the interval of interest. In Section 2.7 we described the oldest and simplest numerical approximation method, namely, the Euler or tangent line method. To derive this method, let us write the differential equation (1) at the point  =   in the form   (  ) = (  , (  )). (3) Then we approximate the derivative in equation (3) by the corresponding (forward) difference quotient, obtaining ( +1 ) − (  )  +1 −   ≅ (  , (  )). (4) Finally, if we replace ( +1 ) and (  ) by their approximate values  +1 and   , respectively, and solve for  +1 , we obtain the Euler formula  +1 =   + (  ,   )( +1 −   ),  = 0, 1, 2, ... . (5) 364 CHAPTER 8 Numerical Methods If the step size  +1 −   has a uniform value ℎ for all  and if we denote (  ,   ) by   , then equation (5) simplifies to  +1 =   + ℎ  ,  = 0, 1, 2, ... . (6) Euler’s method consists of repeatedly evaluating equation (5) or (6), using the result of each step to execute the next step. In this way we obtain a sequence of values  0 ,  1 ,  2 , ... ,   , ... that approximate the values of the solution () at the points  0 ,  1 ,  2 , ... ,   , ... . A computer program for Euler’s method has a structure such as that shown below. The specific instructions can be written in any convenient programming language. The Euler Method Step 1. define (, ) Step 2. input initial values  = 0 and  = 0 Step 3. input step size ℎ and number of steps  Step 4. output 0 and 0 Step 5. for  from 1 to  do Step 6.   = (, )  =  + ℎ ∗    =  + ℎ Step 7. output  and  Step 8. end Some examples of Euler’s method appear in Section 2.7. As another example, consider the initial value problem  ′ = 1 −  + 4, (7) (0) = 1.
  • Book cover image for: Introductory Numerical Analysis
    3. EULER’S METHOD
    One of the simplest numerical procedures for obtaining particular solutions of the first-order differential equation y′ = f (x , y ) in a relatively small region of the xy -plane about a given point (x 0 , y 0 ) is attributed to Euler. The graphical method which was studied in Section 8.2 for solving a first-order differential equation is the geometrical equivalent of Euler’s method.
    Euler’s method involves a linear extrapolation along the tangent line to an integral curve passing through (x 0 , y 0 ). The first step of this method is to determine an increment Δy of the dependent variable for some arbitrary increment Δx of the independent variable from the given point (x 0 , y 0 ). Since
    8 .6
    8.7
    Then
    8.8
    where (x 1 y 1 ) represents the coordinates of a second point on the integral curve y’ = f (x, y ) passing through (x 0 , y 0 ) such that x 1 = x 0 + Δx 0 . A repetition of the process yields an approximation to a third point (x 2 , y 2 ) on the integral curve, where x 2 = x 1 + Δx 1 and
    y 2 = y 1 + Δy 1 y 1 + f (x 1 , y 1 ) Δx 1 .
    Note that the y 1 used here is equal to the approximation obtained in (8.8) since we cannot obtain the exact value of y 1 . In general, an approximation to the coordinates of an (n + 1)th point on the integral curve is obtained by using the recursion formulas
    8.9
    8.10
    and is called Euler’s method. In calculating a set of approximations to the points on a particular integral curve, Δx i is usually chosen as some convenient constant for all values of i . Hereafter, we shall omit the subscripts for Δx i in such instances.
    Furthermore, we shall write
    8.11
    when using Euler’s method, noting that y n is an approximation. In discussing other numerical procedures, it will often be convenient to use the equal sign for an approximation. The context of the discussion will usually denote when an approximation is implied.
     
    EXAMPLE 1. Approximate the particular solutions over the interval 0 ≤ x ≤ 1 of the differential equation y′ = y x through (0, 2). Let Δx
  • Book cover image for: Legacy Of Leonhard Euler, The: A Tricentennial Tribute
    • Lokenath Debnath(Author)
    • 2009(Publication Date)
    • ICP
      (Publisher)
    (9.2.67) During the seventeenth and eighteenth centuries, mathematicians made serious attempts to solve ordinary differential equations in terms of elemen-tary functions and quadratures. When these methods failed, they solved equations by means of infinite series and by numerical methods. We con-clude this section by adding Euler’s numerical method. In 1768, Euler developed a simple finite difference method for the numerical solution of an ordinary differential equation dy dx = f ( x, y ) , (9.2.68) with the given initial condition y ( x 0 ) = y 0 . (9.2.69) With a uniform step size h between the points x 0 , x 1 , x 2 , · · · , Euler constructed points x n +1 = x 0 + ( n + 1) h = x n + h , n = 0, 1, 2, · · · , and then obtained the formula y n +1 = y n + h f ( x n , y n ) = y n + h y n + O ( h 2 ) . (9.2.70) If f ( x, y ) is continuous, then the sequence of Euler polygonal lines converges uniformly as h → 0 to the unknown function y ( x ) on a sufficiently small closed interval containing x 0 . However, Euler’s formula is not an accurate formula. The modified Euler formula for the initial value problem (9.2.68)– (9.2.69) is given by y n +1 = y n + h f x n + 1 2 h, y n + 1 2 h y n + O ( h 3 ) . (9.2.71) The so-called improved Euler method is a simple refinement of the Euler method that takes into account of the average value of the gradient at the 274 The Legacy of Leonhard Euler — A Tricentennial Tribute end points ( x n , y n ) and ( x n +1 , y n +1 ). So, the improved Euler formula for the initial value problem (9.2.68)–(9.2.69) is given by y n +1 = y n + h f ( x n , y n ) + f ( x n +1 , y n +1 ) h = y n + h 2 [ f ( x n , y n ) + f ( x n + h, y n + hy n )] + O ( h 3 ) , (9.2.72) where x n +1 has been replaced by ( x n + h ). Subsequently, further refinement of the Euler method and its modifi-cations was made by Carl Runge (1856-1927) in 1895 and M. W. Kuttta (1867-1944) in 1901 who based their work on the Taylor series approxima-tion.
  • Book cover image for: Elementary Differential Equations with Linear Algebra
    • Albert L. Rabenstein(Author)
    • 2014(Publication Date)
    • Academic Press
      (Publisher)
    Numerical Methods 8.1 THE EULER METHOD In this chapter we shall describe some techniques that can be used to obtain approximate values of the solution of an initial value problem for a first-order differential equation. Such an initial value problem is of the form y=f(*,y y( x o) = y 0 · (8.1) If h is a small positive number, we write x i = x o + K x 2 = x i + h = x o + 2Λ, x 3 = x 2 + h = x 0 + 3h, and so on. In general, x n = x 0 -f nh. We refer to h as the step size to be used in the numerical method. We also use the abbreviations )>i = y{xi)> yi = y(*i . . . j B = y{x n ) for the exact values of the solution at the points x 1? x 2 , ..., x n . If a formula for the solution is not available, then these values are not known. For example, the problem / = x 2 + y y(0) = 1 appears simple, but no explicit formula for its solution is known. 419 420 Numerical Methods In the methods to be investigated in this chapter, an approximation to y u denoted by w l9 is calculated. Then an approximate value vv 2 for y 2 is found, and so on. These approximate values are calculated step by step, with the value of w 2 depending on w l (and perhaps on w 0 also), while w 3 depends on w 2 (and possibly on w x and w 0 also). If w n depends only on w„_ l (and not on w„_ 2 or other previously calculated values) the method is called a single-step method (as opposed to a multi-step method). We shall investigate several single-step methods and then conclude the chapter with a discussion of a multi-step technique. All the single-step methods we shall discuss are based on Taylor's formula, which is derived in most calculus textbooks. This formula states that (under appropriate conditions 1 ) y(x + h) = y(x) + hyx) + ~ y(x) + ~'+^ / ° Μ + **(*, h where with ξ between x and x + h. In particular, if k = 1, we have y (x + h) = y(x) + hy'(x) + R^x, h and R l is proportional to h 2 .
  • Book cover image for: Differential Equations
    eBook - ePub

    Differential Equations

    Theory,Technique and Practice with Boundary Value Problems

    Chapter 4

    Numerical Methods

    • The idea of a numerical method
    • Approximation
    • Error terms
    • Euler’s method
    • Improved Euler method
    • Runge-Kutta method
    The presentation in this book, or in any standard introductory text on differential equations, can be misleading. A casual reading might lead the student to think that “most” differential equations can be solved explicitly, with the solution given by a formula. Such is not the case. Although it can be proved abstractly that most any ordinary differential equation has a solution—at least locally—it is in general quite difficult to say in any explicit manner what the solution might be. As we saw in Chapter 3 , it is sometimes possible to say something qualitative about solutions. And we have also seen that certain important equations that come from physics are fortuitously simple, and can be attacked effectively. But the bottom line is that many of the equations that we must solve for engineering or other applications simply do not have closed-form solutions. Just as an instance, the equations that govern the shape of an airplane wing cannot be solved. Yet we fly every day. How do we come to terms with the intractability of differential equations?
    The advent of high-speed digital computers has made it both feasible and, indeed, easy to perform numerical approximation of solutions. The subject of the numerical solution of differential equations is a highly developed one, and is applied daily to problems in engineering, physics, biology, astronomy, and many other parts of science. Solutions may generally be obtained to any desired degree of accuracy, graphs drawn, and any desired analysis performed.
    Not surprisingly—and like many of the other fundamental ideas related to calculus—the basic techniques for the numerical solution of differential equations go back to Newton and Euler. This is quite amazing, for these men had no notion of the computing equipment that we have available today. Their insights were quite prescient and powerful.
  • Book cover image for: A First Course in Differential Equations with Modeling Applications, International Metric Edition
    368 9.1 Euler Methods and Error Analysis 9.2 Runge-Kutta Methods 9.3 Multistep Methods 9.4 Higher-Order Equations and Systems 9.5 Second-Order Boundary-Value Problems C H A P T E R 9 I N R E V I E W E ven if a solution of a differential equation exists, we may not be able to exhibit it in explicit or implicit form. In many instances we have to be content with an approximation of the solution. If a solution exists, it represents a set of points in the Cartesian plane. In this chapter we continue to explore the basic idea introduced in Section 2.6, that is, using the differential equation to construct an algorithm to approximate the y -coordinates of points on the actual solution curve. Our concentration in this chapter is primarily on first-order initial-value problems, but it concludes with a method for approximating solutions of linear second-order boundary-value problems. 9 Numerical Solutions of Ordinary Differential Equations Paul B. Moore/Shutterstock.com Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-300 9.1 EULER METHODS AND ERROR ANALYSIS 369 INTRODUCTION In Chapter 2 we examined one of the simplest numerical methods for approximating solutions of first-order initial-value problems y 9 5 f ( x , y ), y ( x 0 ) 5 y 0 . Recall that the backbone of Euler’s method is the formula y n 1 1 5 y n 1 hf ( x n , y n ) , (1) where f is the function obtained from the differential equation y 9 5 f ( x , y ). The recursive use of (1) for n 5 0, 1, 2, . . . yields the y -coordinates y 1 , y 2 , y 3 , . . . of points on successive “tangent lines” to the solution curve at x 1 , x 2 , x 3 , . . . or x n 5 x 0 1 nh , where h is a constant and is the size of the step between x n and x n 1 1 . The values y 1 , y 2 , y 3 , . . . approximate the values of a solution y ( x ) of the IVP at x 1 , x 2 , x 3 , .
  • Book cover image for: Numerical Solution of Ordinary Differential Equations
    • Kendall Atkinson, Weimin Han, David E. Stewart(Authors)
    • 2011(Publication Date)
    • Wiley
      (Publisher)
    3.2 NUMERICAL METHODS FOR SYSTEMS Euler's Method and the numerical methods discussed in later chapters can be applied without change to the solution of systems of first-order differential equations. The numerical method should be applied to each equation in the system, or more simply, in a straightforward way to the system written in the matrix-vector format (3.7). The derivation of numerical methods for the solution of systems is essentially the same as is done for a single equation. The convergence and stability analyses are also done in the same manner. To be more specific, we consider Euler's Method for the general system of two first-order equations that is given in (3.1). By following the derivation given for Euler's Method in obtaining (2.9), Taylor's theorem gives Yi(t n+1 ) = Y^tn) + hhiUMtJMtn)) + yYi"(£ ), h 2 Y 2 (t n+1 ) = Y 2 (tn) + hf 2 {tn,Y l {t n ),Y 2 {t n )) + y*7(Cn) for some £ , £ n in [t n , t n +i]- Dropping the error terms, we obtain Euler's Method for a system of two equations for n > 0: yi,n+l =yi,n + hfl(t n ,yi y n,y2,n), (3.22) 2/2,n+i = 2/2,n + hf 2 (t n ,yi
  • Book cover image for: Differential Equations
    eBook - ePub

    Differential Equations

    A Modern Approach with Wavelets

    5

    Numerical Methods

    •  The idea of a numerical method •  Approximation •  Error terms •  Euler’s method •  Improved Euler method •  Runge–Kutta method
    The presentation in this book, or in any standard introductory text on differential equations, can be misleading. A casual reading might lead the student to think that “most” differential equations can be solved explicitly, with the solution given by a formula. Such is not the case. Although it can be proved abstractly that most any ordinary differential equation has a solution—at least locally—it is in general quite difficult to say in any explicit manner what the solution might be. It is sometimes possible to say something qualitative about solutions. And we have also seen that certain important equations that come from physics are fortuitously simple, and can be attacked effectively. But the bottom line is that many of the equations that we must solve for engineering or other applications simply do not have closed-form solutions. Just as an instance, the equations that govern the shape of an airplane wing cannot be solved. Yet we fly every day. How do we come to terms with the intractability of differential equations?
    The advent of high-speed digital computers has made it both feasible and, indeed, easy to perform numerical approximation of solutions. The subject of the numerical solution of differential equations is a highly developed one, and is applied daily to problems in engineering, physics, biology, astronomy, and many other parts of science. Solutions may generally be obtained to any desired degree of accuracy, graphs drawn, and any desired analysis performed.
    Not surprisingly—and like many of the other fundamental ideas related to calculus—the basic techniques for the numerical solution of differential equations go back to Newton and Euler. This is quite amazing, for these men had no notion of the computing equipment that we have available today. Their insights were quite prescient and powerful.
  • Book cover image for: Differential Equations with Applications and Historical Notes
    2 , etc. Our general purpose is to apply enough of the details of each method to enable the reader to apply it for himself if the need should ever arise. We avoid details dealing with the plethora of computing machines and programming languages for several reasons. First, those issues are best left to specialized texts in numerical analysis. Second, it is our experience that virtually all students have some familiarity with computing fundamentals and should be able to write programs where appropriate to perform the calculations required by the exercises in this chapter. As to the means, that is better left to the student and his teacher. Third, advances in computing continue at a dizzying pace, and we see no need to burden this book with nonmathematical details that might well be obsolete in only a few short years.
    We shall illustrate our methods by applying them to the simple problem
    y
    = x + y , y
    ( 0 )
    = 1 ,
    (3)
    which we call our benchmark problem. This differential equation in (3) is clearly linear, and the exact solution is easily found to be
    y = 2
    e x
    x 1.
    (4)
    We have chosen (3) as our benchmark problem for two reasons. First, it is so simple that a numerical method can be applied to it by hand without obscuring the main steps by a morass of computations. Second, the exact solution (4) can easily be evaluated for various x’s with the aid of a pocket calculator, so we have a means of judging the accuracy of the approximate solutions produced by our numerical methods.

    Problem

    1.  Have you encountered any examples in other courses where either the textbook or the instructor referred to numerical solutions of ordinary differential equations? Give an example and discuss what you read or heard.

    73  The Method of Euler

    If we integrate the differential equation in (2) from x0 to x1 = x0 + h, and use the initial condition y(x0 ) = y0
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.