Physics 410/609---Computational Physics
Assignment #3---Due Tuesday, February 21
NOTE: At the end of each problem, please indicate how long it took
to solve the problem.
1) Complete Problem 3.9 on pages 63-64 of CSM. You should use the
Euler-Richardson algorithm and include a copy of your code.
The Euler-Richardson algorithm is described on page 46 of CSM.
You are welcome to use my fall_euler_ansi.c program as a starting point
for your Euler-Richardson program, if you like. The program can be found
in ~sg. In any case, your homework should contain a copy of your codes
for problems 1 and 2.
2) a) Compute the period of the anharmonic oscillator for initial amplitude
1 for various strengths of the potential and determine the relation
between the period and k/m, where the potential is k*x**4/4 .
Use the fourth order Runge-Kutta method for this problem. This
method is explained in Numerical Recipes (see below) and the appendix
of CSM Chapter 3. Please note that in class I pointed out errors in
Eqs. (3.61g) and (3.61h). The class web page includes a link to a
list of corrections to the book.
To get an accurate value for the period, it may be useful to run
several oscillation periods and then divide the time by the number
of periods.
The best way to see the relationship between the period and k/m is
to use a log-log plot.
You may need to adjust the step size as you change the value of k.
It is a good idea to monitor how well the energy is conserved.
b) Read sections 17.0-17.4 of Numerical Recipes (NR) in the chapter on
Integration of Ordinary Differential Equations. If you are looking at
an edition of NR other than the 3rd, it could be a different chapter
number, but the chapter title should be the same.
3) Using Mathematica, find the value of the integral of the function sin(x)/x
over the interval [0,5].