Autumn 2001

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.

- As discussed in class, the differential equation
for a damped harmonic oscillator is
`y`''+ 2`b``y`' +`w`^{2}`y`=0`y`(`t`) is the amplitude as a function of time. By defining new variables`y`_{1}=`y`and`y`_{2}=`y`', write this as a set of two coupled first order differential equations. - Using the finite difference method that we have introduced in
class, write a program that calculates
`y`_{1}and`y`_{2}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. - 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`)`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? - Now, let us try a phase space plot. Plot a graph of
`y`_{2}versus`y`_{1}. 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? - 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`? -
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. -
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:

I used Gnuplot command`splot "junk.dat" with lines`

to make this graph. **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`.`sigma`=10,`b`=8/3, and`r`=28. Plot some phase space diagrams for`t`between 0 and 20.