Naive numerical approximations next up previous
Next: About this document Up: No Title Previous: The harmonic oscillator

Naive numerical approximations

When an analytical solution to a problem is not available, then one must resort to numerical methods for solving Newton's equations. In the average numerical methods book, some methods that appear there are

1.
Runge-Kutta methods.
2.
Predictor-corrector methods.
3.
Euler's method.
4.
Verlet (and variant) methods.

Of these, only the last is suitable for use with Newton's equations. The reason for this will be made clear later when we study the fundamental symmetries of Newton's equations and then require the any numerical method respect those symmetries. Most available methods do not.

Once again, we shall illustrate the problem of numerical solution by considering a single particle moving in one dimension. This will be easily generalizable to N particles moving in three dimensions. In the one-dimensional case, we have to solve

displaymath75

subject to the initial conditions x(0), v(0). The solution will be uniquely given as functions of t and x(0) and v(0):

eqnarray162

such that f(0;x(0),v(0)) = x(0) and g(0;x(0),v(0)) = v(0) and tex2html_wrap_inline498 . An obvious approach would be simply to perform a Taylor expansion of the unknown functions f and g about t=0,

eqnarray165

Recognizing that tex2html_wrap_inline506 , we can write the position equation as

displaymath175

Now since we do not have any information about the system beyond the second derivative (Newton's second law tells nothing about tex2html_wrap_inline508 , for example), we need to truncate the expansion at the second order term. Thus, it will only be valid for times small enough that the tex2html_wrap_inline510 term can be considered negligible. Let us introduce a small time interval tex2html_wrap_inline512 and write

displaymath178

which tells us that the solution will be good up to second order in tex2html_wrap_inline512 .

Unfortunately, if we look at the velocities, we actually need to truncate this expansion at the first order, since we know nothing about tex2html_wrap_inline516 . If we truncate v(t) at first order, however, we have

displaymath184

which is only good to first order in tex2html_wrap_inline512 .

It would be far better if we could find an approximation for v(t) that was good to second order in tex2html_wrap_inline512 just as the position is. In fact, this is possible if we only use the information in the position equation. To this end, we seek an expression for tex2html_wrap_inline526 . This can be obtained by taking the position equation

displaymath189

where, although ``='' is used, it must be remembered that the solution is now an approximate solution, not the true solution. Let us now consider starting from tex2html_wrap_inline512 and applying the rule backwards in time (i.e. for a time tex2html_wrap_inline530 ) so that we end up back at x(0). The rule would be

displaymath192

Now, if we solve this for tex2html_wrap_inline526 , we find

displaymath195

Using the rule for tex2html_wrap_inline536 , we have tex2html_wrap_inline538 so that

displaymath199

The combination of the two rules gives a numerical algorithm:

eqnarray202

which is known as the velocity Verlet algorithm. Note that both the position and velocity are good to second order in tex2html_wrap_inline512 . It is one of the most widely used algorithms for solving Newton's equations numerically. It will be shown later that the algorithm respects all of the fundamental symmetries of Newton's equation.

Note that it is straightforward to generalize the algorithm for N particles moving in 3 dimensions:

eqnarray208

where the shorthand notation tex2html_wrap_inline544 means tex2html_wrap_inline546 and tex2html_wrap_inline548 means tex2html_wrap_inline550 .

Some comments are in order at this point:

1.
Note that the algorithm can be iterated. Given x(0) and v(0), we use the rules once to obtain tex2html_wrap_inline556 . Then, given these, we can use the rules again to obtain tex2html_wrap_inline558 according to

eqnarray214

and the procedure can be repeated to yield tex2html_wrap_inline560 , thereby generating a solution of total time tex2html_wrap_inline562 at discrete time points, tex2html_wrap_inline512 , tex2html_wrap_inline566 ,..., tex2html_wrap_inline568 .

2.
The overall error in a solution of n iterations of the rules will not actually be the same as the error in a single iteration (which is good to second order in tex2html_wrap_inline512 ). To see this, note that the overall error after n iterations will be

displaymath218

Thus, the overall error in a solution of total time t will be good only to first order in tex2html_wrap_inline512 with a prefactor that grows as t. It is important to keep this in mind when quoting time-step errors in numerical solutions.

3.
Other popular numerical solution methods that are equivalent or nearly equivalent to the velocity Verlet method exist. One of these is the so called Verlet method given by

displaymath223

Note that the velocities are not used here, explicitly, and must be obtained by a finite difference formula

displaymath226

This method is exactly equivalent to velocity Verlet.

Another populat method is the so called position Verlet method given by

eqnarray229

We will see later how algorithms such as these are derived in a more formal and powerful way. It will also be shown there that the position Verlet method is not exactly equivalent to the velocity Verlet method, although it is also an algorithm that is good to second order in tex2html_wrap_inline512 .


next up previous
Next: About this document Up: No Title Previous: The harmonic oscillator

Home: Top

Mark Tuckerman
Sat Sep 14 17:06:36 EDT 2002