Numerical Methods, MAT 350
Autumn 2001


Homework: Differential Equations

Due by class, December 7, 2001 (OK, you have an extention to the end of finals week.)

Michael Cross at Caltech has some nice material on chaotic systems. He has written a series of demonstrations.

This is your last homework set for this class; I hope that it will not be too hard. In this homework, we will look at numerical solutions of differential equations. We will use phase space diagrams to study them.

  1. As discussed in class, the differential equation for a damped harmonic oscillator is
    y''+ 2 b y' + w2 y=0
    where y(t) is the amplitude as a function of time. By defining new variables y1=y and y2=y', write this as a set of two coupled first order differential equations.
  2. Using the finite difference method that we have introduced in class, write a program that calculates y1 and y2 as a function of time t. (This is the Euler method. In a more serious study, one would use the fourth-order Runge-Kutta method discussed in Chapter 16 of the textbook.) A step size of h=0.01 will give sufficient accuracy for this assignment.
  3. To test the program, let us consider the case with no damping, b=0. In this case, the solution of the differential equation is
    y = A cos(w t) + B sin(w t)
    where the constants A and B are determined by the boundary conditions. Set the frequency w=1.0, and boundary conditions y(0)=1 and y'(0)=0. Find y numerically for t between 0 and 20. Plot both the exact and numerical solutions as a function of time. How well do they agree?
  4. Now, let us try a phase space plot. Plot a graph of y2 versus y1. What is the shape of the curve that you see? What would happen if you chose y(0)=0.5 and y'(0)=0 as your boundary condition? How does the value of w affect the shape of this curve?
  5. Next, let us explore the damped harmonic oscillator. Make phase space plots for several values of the damping parameter b=0.1, 0.5, and 1.0 What happens to the trajectories in the limit of infinite t?
  6. Read lecture notes and demonstrations for the Lorenz model written by Michael Cross at Caltech. Write a paragraph explaining what the butterfly effect is. The equations for the Lorenz model are autonomous; explain what this means.
  7. Use the Lorenz model demonstration to demonstrate the butterfly effect. (You will need to press the "reset" button after making any changes to the parameters.) Record your results.

    This demonstration shows the trajectory for only two of the coordinates. A plot in terms of all three coordinates looks like this:

    Lorenz model phase space plot

    I used Gnuplot command splot "junk.dat" with lines to make this graph.
  8. Extra Credit: Write your own program to solve the Lorenz model,
    x' = sigma (y - x)
    y' = r x - y - x z
    z' = x y - b z.
    For the constants, you can try the same values that Lorenz used in his famous paper: sigma=10, b=8/3, and r=28. Plot some phase space diagrams for t between 0 and 20.