Euler method

From Wikipedia, the free encyclopedia

Illustration of the Euler method. The unknown curve is in blue, and its polygonal approximation is in red.
Illustration of the Euler method. The unknown curve is in blue, and its polygonal approximation is in red.

In mathematics and computational science, the Euler method, named after Leonhard Euler, is a first order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. It is the most basic kind of explicit method for numerical integration for ordinary differential equations.

Contents

[edit] Informal geometrical description

Consider the problem of calculating the shape of an unknown curve which starts at a given point and satisfies a given differential equation. Here, a differential equation can be thought of as a formula by which the slope of the tangent line to the curve can be computed at any point on the curve, once the position of that point has been calculated.

The idea is that while the curve is initially unknown, its starting point, which we denote by A0, is known (see the picture on top right). Then, from the differential equation, the slope to the curve at A0 can be computed, and so, the tangent line.

Take a small step along that tangent line up to a point A1. If we pretend that A1 is still on the curve, the same reasoning as for the point A0 above can be used. After several steps, a polygonal curve A_0A_1A_2A_3\dots is computed. In general, this curve does not diverge too far from the original unknown curve, and the error between the two curves can be made small if the step size is small enough and the interval of computation is finite (although things are more complicated for stiff equations, as discussed below).

[edit] Derivation

Illustration of numerical integration for the equation y' = y,y(0) = 1. Blue: the Euler method, green: the midpoint method, red: the exact solution, y = et. The step size is h = 1.0.
Illustration of numerical integration for the equation y' = y,y(0) = 1. Blue: the Euler method, green: the midpoint method, red: the exact solution, y = et. The step size is h = 1.0.
The same illustration for h = 0.25. It is seen that the midpoint method converges faster than the Euler method.
The same illustration for h = 0.25. It is seen that the midpoint method converges faster than the Euler method.

We want to approximate the solution of the initial value problem

y'(t) = f(t,y(t)), \qquad \qquad y(t_0)=y_0,

by using the first two terms of the Taylor expansion of y, which represents the linear approximation around the point (t0,y(t0)) . One step of the Euler method from tn to tn+1 = tn + h is

 y_{n+1} = y_n + hf(t_n,y_n).  \qquad \qquad

The Euler method is explicit, i.e. the solution yn + 1 is an explicit function of yi for i \leq n.

While the Euler method integrates a first order ODE, any ODE of order N can be represented as a first-order ODE in more than one variable by introducing N − 1 further variables, y', y'', ..., y(N), and formulating N first order equations in these new variables. The Euler method can be applied to the vector \mathbf{y}(t)=(y(t),y'(t),y''(t),...,y^{(N)}(t)) to integrate the higher-order system.

[edit] Error

The magnitude of the errors arising from the Euler method can be demonstrated by comparison with a Taylor expansion of y. If we assume that f(t) and y(t) are known exactly at a time t0, then the Euler method gives the approximate solution at time t0 + h as:

y(t_0 + h) = y(t_0) + h f(t_0,y(t_0)) = y(t_0) + h y'(t_0) \, \qquad \qquad

(the second equality holds because y satisfies the differential equation y' = f(t,y)). In comparison, the Taylor expansion in h about t0 gives:

y(t_0 + h) = y(t_0) + h y'(t_0) + \frac{1}{2}h^2 y''(t_0) + O(h^3).

The error introduced by the Euler method is given by the difference between these equations:

\frac{1}{2}h^2 y''(t_0) + O(h^3).

For small h, the dominant error per step is proportional to h2. To solve the problem over a given range of t, the number of steps needed is proportional to 1 / h so it is to be expected that the total error at the end of the fixed time will be proportional to h (error per step times number of steps). For this reason, the Euler method is said to be first order. This makes the Euler method less accurate (for small h) than other higher-order techniques such as Runge-Kutta methods and linear multistep methods.

The Euler method can also be numerically unstable, especially for stiff equations. This limitation—along with its slow convergence of error with h—means that the Euler method is not often used, except as a simple example of numerical integration.

[edit] See also

[edit] External links

[edit] References

  • Ascher, Uri M.; Petzold, Linda Ruth. Computer methods for ordinary differential equations and differential-algebraic equations. 1998. SIAM. ISBN 0898714125