The Euler-Cromer method
Although the Euler method is simple to apply, it is not very accurate. Here we discuss one improvement to the Euler method that is particularly useful for investigating oscillating systems. As an example of such a system consider a harmonic oscillator. This could be a mass attached to an ideal spring or a simple pendulum of small amplitude.
For a pendulum of length l, and mass m, the angle with respect to the vertical satisfies
|
|
(1.1) |
For small amplitude, we can use the approximation
|
|
(1.2) |
(where
is measured in radians) so that
|
|
(1.3) |
This is the equation for simple harmonic motion with angular frequency
|
|
(1.4) |
For such a system the total energy
|
|
(1.5) |
is conserved.
For a numerical method to give a physically correct result the total energy
should be conserved or at least it should remain approximately constant over
many periods of oscillation. Let’s see if the Euler method does this. To reduce
the number of symbols, use
as the unit of time and mgl as the unit of energy. The equations become
|
|
(1.6) |
and
|
|
(1.7) |
To apply Euler’s method, use the angular velocity
|
|
(1.8) |
as a second dependent variable. The basic Euler step is
|
|
(1.9) |
To see if the energy is conserved consider
|
|
(1.10) |
Hence we conclude that the Euler method has the undesirable property that it makes En increase with time.
A simple modification to the Euler method goes some way to fixing this problem. Replace the basic Euler step by
|
|
(1.11) |
This is called the Euler-Cromer method
The reason why this modification works is not trivial but for those of you who are interested in finding out why, read on!
With this change you can show that
|
|
(1.12) |
Now
the term proportional to
can be positive or negative. For simple harmonic motion the exact solution
is
|
|
(1.13) |
so that
|
|
(1.14) |
This
means that the average value of
over one complete period of oscillation is zero. A more complete analysis shows
that for oscillatory motion the energy increase over one complete cycle using
the Euler-Cromer method is proportional to
whereas for the Euler method the energy increase is proportional to
.