February 11, 2016 --- Class 10 --- Sources of Numerical Analysis Code,
Final Project, Graphing options, Higher Order Algorithms
Activities:
Sources of Numerical Analysis Code
So far, we have built our own codes from scratch; however,
you will probably find it very useful to make use of
standard codes that are already debugged. Two good sources
of code for numerical analysis are the book "Numerical
Recipes" (which is recommended for this course) and the GNU
scientific library.
GNU scientific library can be found at:
http://www.gnu.org/software/gsl
Code from Numerical Recipes is not so freely available. But
older versions of the text and source can be found here:
http://www.nrbook.com
The latest version of the book and information about electronic
access are here:
http://www.nr.com
Final Project
It is time to start thinking about your final project. Some
of you may have a problem related to your research that can
be used for the project. If not, there may be some problem
that interests you that would serve as a project. If you
don't have an idea of your own, you might like to look through
our text book. If there is a chapter that we will not cover,
you might find some homework problems that can be combined to
make a project. The book also has some suggestions for
projects. Some of these, even in chapters we will (partially)
cover make suitable projects. So start to think about what
you want to do, because in a couple of weeks, I will be asking
everyone to get their project approved by me.
Here is how the final project will be graded:
Statement 10
Eq Solved 5
Num. Method 5
Code 5
Results 10
Discussion 10
Critique 5
------------------
Total 50
Some graphing options
Axis has useful options to break lines, label lines and
add color to the plot. I demonstrated several of these
in the file ~sg/chap4/euler_energy.ax. This graph shows
how the energy grows when using the Euler algorithm and three
different step sizes. Students should make a similar graph but
for the Euler-Cromer algorithm. In that case, the energy
does not grow, it oscillates around the correct value.
The amplitude of oscillation decreases when the step size
decreases.
Higher order algorithms
We talked about several algorithms including leap frog,
Adams-Bashforth and Runge-Kutta. Euler-Richardson is
basically the 2nd order Runge-Kutta algorithm. We also
talked about the 4th order Runge-Kutta algorithm. Many of
these algorithms are presented in Appendix 3A of Chapter 3.,
starting on page 74. There are two typos in the book regarding
the 4th order R-K algorithm. In Eq. (3.61g), the right-hand-
side should be multiplied by Delta t. In Eq. (3.61h), k_3x
on the RHS should be k_3v. Corrections to the textbook can
be found at http://physics.clarku.edu/sip/3e/updates.html .
You may also find more about these algorithms in "Numerical
Analysis" by Burden and Faires, or "Numerical Recipes" by
Press et al.
My notes can be found at
http://www.physics.indiana.edu/~sg/p609/ode_algorithms.pdf
or on the cluster in ~sg/ode_algorithms.pdf .
We also looked briefly at the documentation for the GNU
Scientific Library and saw that a large number of algorithms
are available.