Next: 2. Linear Algebra Up: 1. Finite Difference Calculus Previous: 1.3.4 Second derivatives in

# 1.4 Sample Applications

A. Newton' equation for an oscillator

Step-by-step integration!

This is the famous Stoermer-Verlet algorithm.

Applicable for any right hand side, and for any number of coupled equations of motion!

Here is a realization of this algorithm, along with several others that will be explained later:

 (An-) Harmonic Oscillator: Start Applet

(1) To try out various harmonic and anharmonic oscillators, you may change the parameters and in the text panels.

(2) To get a feeling for the limitations of the Verlet algorithm, play around with .

EXERCISE:
a) Write a program to tabulate and/or draw the analytical solution to the HO equation. (You may achieve a very concise visualization by displaying the trajectory in phase space, i.e. in the coordinate system ; where for the approximation may be used.) Choose values of , and , and use these to determine the exact value of . Starting with and , employ the above algorithm to compute the further path . Test the performance of your program by varying and .
b) Now apply your code to the anharmonic oscillator

To start the algorithm you may use the approximate value given by

EXERCISE:
The planar pendulum is described by the equation of motion

Solution strategies vary between the three regions: very small; small; arbitrary.

Very small : Here , and the e.o.m. is that of a harmonic oscillator, with the usual analytic solution.

Small : We may put , adding an anharmonic term to the e.o.m. Again, an analytical solution may be found, but it is more involved than in the harmonic case; see Landau-Lifshitz, Mechanics.

Any : The exact solution is known in implicit form:

One may clumsily invert this equation for regular times , using Newton-Raphson.

Instead, one may choose to simulate the pendulum, using the Stoermer-Verlet algorithm:

As a starting value for one may use the Taylor approximation

B. Thermal Conduction

Writing , FTCS scheme'' (forward-time, centered-space'')

or

for (and , given as boundary conditions).

EXERCISE: Let us divide the rod into pieces of equal length, with node points , and assume the boundary conditions and . The values for the temperature at time (the initial values) are and (step function).

Next: 2. Linear Algebra Up: 1. Finite Difference Calculus Previous: 1.3.4 Second derivatives in
Franz J. Vesely Oct 2005