Numerical ODEs · Definition

Euler's method

numerical methodsnumerical odes

Before you start you need to know

Euler proposed a very simple idea for approximating curves: follow the tangent line over a short interval. That geometric intuition leads to a scheme that can be coded in a few lines.

Definition

Euler's method approximates the solution of an initial value problem \(y'=f(t,y)\), \(y(t_0)=y_0\), advancing in steps of size \(h\) using the slope at the current point.

\[y_{n+1}=y_n+h\,f(t_n,y_n)\]

The method follows from the first-order Taylor expansion \(y(t_{n+1})\approx y(t_n)+h\,y'(t_n)\), and since \(y'(t_n)=f(t_n,y_n)\) we obtain the iterative formula. Its local error is of order \(O(h^2)\), and accumulating over \(N\approx (b-a)/h\) steps gives a global error of order \(O(h)\), so it is a first-order method.

For \(y'=y\), \(y(0)=1\) and \(h=0.1\), the first iteration gives \(y_1=1+0.1\cdot 1=1.1\), while the exact solution at \(t=0.1\) is \(e^{0.1}\approx 1.1052\). The approximation is reasonable, but the error grows with \(h\).

A typical mistake is forgetting that the slope is evaluated at the initial point of the interval and using \(f(t_{n+1},y_{n+1})\) instead, which gives a different implicit method. Another frequent error is taking a step \(h\) that is too large, which can produce oscillations or divergence even when the exact solution is stable.

Think about it

Why is Euler's global error of order one when its local error is of order two?

Because accumulating \(N\approx (b-a)/h\) local errors of size \(O(h^2)\) gives a total of \(O(h)\).

Exercises 10

References

  • Richard L. Burden, J. Douglas Faires, Annette M. Burden, Numerical Analysis, 10th edition, Cengage Learning, 2016.
  • Lloyd N. Trefethen, David Bau III, Numerical Linear Algebra, 1st edition, SIAM, 1997.