Euler's Algorithm

A simple algorithm to predict one step of the solution to the differential equation (4) substitutes a derivative algorithm into the equation:

[Euler algorithm]

Here we have assumed the time t=nh moves ahead in uniform ``ticks'' of length h. (If you are not familiar with numerical integration rules, we suggest you program up Euler's rule and gain some experience in stepping and in the meaning of f.) We know from our discussion of differentiation that the error in (55) is O(h^3) .

Applying this algorithm to our spring problem for just the first interval gives

eqnarray425

We could continue using these same equations to progressively step (integrate) outwards. Yet this algorithm's equation for the distance covered in one step (58) is not as sophisticated as the one known by all first-year physics students:

[quadratic for x]

Specifically, (58) leaves out the h2-dependent contribution to the distance covered arising from the acceleration. Euler's algorithm thus requires very small step size, and consequently many steps in order to attain precision, and for this reason is subject to roundoff error.

While Euler's algorithm may work well for oscillatory systems where the errors cancel, it is not very accurate, it is prone to instabilities (the numerical solution deviates by an increasing amount from the correct one), and so is not recommended for industrial use. However, Euler's rule (55) does have the strong point of being self starting, that is, you need only know y_0 to get started on your march into the unknown, and consequently it is often used to start some of the more sophisticated algorithms.