PHY301 - Worksheet 2, Fall 2003


Driven, damped, linear oscillations
Initial value problems in ODE's



Due: Oct 10

In many oscillatory physical systems the small amplitude oscillations obey simple harmonic motion. Examples which you study in undergrad. physics include a mass-spring system, a pendulum and an LC circuit. Each of these examples has a ``natural frequency''(in radians/sec)

\begin{displaymath}\omega_0=(k/m)^{1/2},\ \ \omega_0=(g/l)^{1/2},\ \ \ \omega_0=(1/LC)^{1/2}
\end{displaymath} (1)

If we add a small amount of damping or ``dissipation'' to any of these systems, the amplitude of oscillation decreases slowly with time. This is the ``underdamped'' limit. If the dissipation is large the system is ``overdamped'' and the oscillatory behavior ceases altogether. If we also add a sinusoidal driving force, then the frequency of the driving force competes with the ``natural'' frequency of the system. However at a special frequency called the ``resonant frequency'', the driving frequency matches the natural frequency, and the amplitude of oscillations can get very large. Resonance is a very important practical phenomena. For example bridge designers must ensure that the typical winds in an area cannot resonate with a natural frequency of the bridge or disasters can happen. The same is true of skyscraper design.

PROBLEMS

Problem 1. Find the differential equation for driven (with a sinusoidal drive), damped linear oscillations. Give examples of what each term in the equation corresponds to in the cases of: A mass-spring system; A pendulum; A linear(i.e. just resistors, capacitors and inductors) electical circuit. In the mass-spring and pendulum cases, consider dissipation to be due to a ``drag'' force (ie. proportional to velocity).

Problem 2. Mathematica can analytically solve the differential equation for driven; damped linear oscillations. Write a Mathematica code to do this and then use your code to plot the behavior as a function of time. Plot data which illustrate the following behaviors: Underdamped motion; Overdamped motion and; Resonance (here an animation is particularly impressive).

Problem 3. Write a c++ program to solve the differential equation you found in problem 1:

(a) Using the simple (Euler) forward time difference $dx/dt = (x(t+\delta t) - x(t))/\delta t$.

(b) Using the Runge-Kutta method (you can examine the C code in numerical recipes as a starting point; or you can use routines from the GNU Scientific Library -- look under Ordinary Differential Equations).

To use the GNU Scientific Library, the compiler needs to be told about it. Use for example
  g++ -o test.x test.cpp -lgsl -lgslcblas
  ./test6.x
to compile and run a test of the Bessel Function routine:

#include < stdio.h>
#include <./gsl/gsl_sf_bessel.h>
int main()
{
double x = 5.0;
double y = gsl_sf_bessel_J0 (x);
printf ("J0(%g) = %.18e\n", x, y);
return 0;
}

Discussion of various methods for solving these initial value problems can be found in Chapter 16 of Numerical Recipes online and you should read through that chapter, particularly sections 16.1-16.4.

Illustrate the case of underdamped driven oscillations using your code (ie. write a data set to a file and then plot it using xmgrace). Plot and compare your data for the code (a) and for the code (b) with the same time interval. Explain the difference between a ``first order method'' and a ``second order method'' for solving ODE's and hence why the Euler method is poor compared to Runge-Kutta. Note that Runge-Kutta is an old workhorse and a good place to start in understanding higher order ``explicit'' methods. However in research problems other explicit methods such as ``Verlet'', ``Bulirsch-Stoers'' etc. are preferred. Some equations are not well approximated by any explicit method, so that an ``implicit'' method is needed. We shall return to this later in the course when we consider partial differential equations, in particular the Schrodinger equation.