Numerical Methods, MAT 350
Autumn 2001
Syllabus
Lecture:
Monday, Wednesday, Friday,
12:45 to 13:40 in S&E 324.
Instructor:
Brett van de Sande,
Office hours:
By appointment; send me an E-mail if you can not find me.
Textbook:
Numerical Recipes in FORTRAN or
Numerical Recipes in C
by W. Press, S. Teukolsky, W. Vetterling, and B. Flannery,
Cambridge University Press. Students will also need a box
of floppy disks.
Grading: 80% for a series of "mini-projects"
done as homework assignments and 20% for the final exam.
Topics:
- Roots of non-linear equations. We will look at a variety of
approaches and analyze their effectiveness for a variety of ``test
problems.''
- Function minimization.
- Interpolation and extrapolation. We will be rather brief on this
subject, using it mainly as a lead-in to numerical integration
techniques.
- Numerical integration and differentiation We will spend a lot of
time on the important and interesting subject of numerical
integration. Differentiation will only be briefly mentioned.
- Systems of linear equations. First we will start with
Gauß-Jordan elimination.
Then we will study approaches based on matrix factorization.
The use of standard libraries BLAS and LAPACK will be emphasized.
- Eigenvalue problems.
- Differential equations. The numerical solution of differential
equations can be a difficult subject and our treatment will be very
introductory.
- Time permitting, we will finish with a study of more advanced
topic. Possibilities include: Monte Carlo integration, or partial
differential equations using mesh techniques.
Programming:
This course involves a substantial amounts of programming on the
part of the student.
Students may choose between C (or C++) and FORTRAN.
If you are familiar with either of the two languages, feel free to
continue using it.
Each student must own a reference book (or textbook) for the programming
language that they choose. Each student must bring their book to
class and show it to the instructor.
There will also be occasions where results will have to be graphed.
There are several possibilities for accomplishing this: one would be
to use a spreadsheet program such as Microsoft Excel.
One could also use
MATLAB or
Gnuplot;
see my Guide to Using Gnuplot.
Also, students will be required to do background reading at several
World Wide Web sites as well as download standard subroutines
from various Internet sites. Further course
information can be found at the MAT 350 web page:
http://www.geneva.edu/~bvds/mat350; this page will be
updated throughout the term.
Concerning collaboration: I encourage students to discuss with
each other how to solve the problems. I also encourage students
to look at the example problems in the textbook and elsewhere.
However, when you write down your program (or other work) to be handed in,
it must be your own work. If the program (or other work) you hand
in is copied from another student, a textbook, or elsewhere,
that is cheating. If you find yourself in a
situation that is questionable, please explain the situation
on your homework. For example:
"I got lots of help from John Smith
doing problem 3; although I didn't copy, I still don't understand
how the subroutine works."
"My dorm burned to the ground yesterday and I lost everything.
I then copied Joe Smoke Alarm's homework verbatim; I have
no idea what the questions were, let alone the answers."
Homework Assignments
- Machine Epsilon
- Root Finding Algorithms
- Function Minimization
- Polynomial Interpolation
- Integration
- Orthogonal polynomials
- Some Linear Algebra
- Linear Equations and Eigenvalue problems.
- Differential Equations
You should observe the following guidelines:
- You may hand in homework assignments on paper,
as E-mail, or on a floppy disk. Any E-mail or
floppy disk files should be in plain text format.
- Explain in sentence form what you are doing.
Your homeworks should be understandable to someone
who does not know how to solve the problem.
- Include any new code that you wrote (source).
You should comment your code.
- List any standard subroutines used, including:
- subroutine name and what it does.
- what package: BLAS, LAPACK, etc.
- where from: Netlib, etc. Include the URL (the web address) if
it is from an unusual source.
Don't include any print-outs of standard subroutines in your
homeworks.
- Include output of your program. A print-out is not necessary if the
results are then graphed. You can output
your results to a file.
- Any graphs should be properly labelled and explained.
Mathematical software libraries
Information on compilers and computers
You have several options for writing programs for this class.
- The UNIX computers in the physics lab, SE 227 have
FORTRAN and C/C++ available.
E-mail me for permission
and instructions if you would like to use these machines.
- The UNIX computers in SE 128 have FORTRAN and C/C++ available.
However, these computers are old and slow.
- Code Warrior is available in the Geneva computer labs.
You will have to learn how to make "projects."
C and C++ are available.
Even I could learn it in a short time
(with a little help).
Here are some hints for programming on the UNIX machines:
- Read the list of general instructions I gave you.
-
The Fortran compiler is run using the command
g77
;
C is gcc
; and C++ is g++
.
- If you don't specify an output file name, the
executable is put in a file
a.out
.
I like to specify the name for the executable; for example
g77 -o macheps macheps.f
produces an executable
macheps
.
Executables are run by typing the name of the executable.
- If you use math functions on the UNIX computers, you
will have to tell the compiler to link to the math library:
gcc myprogram.c -lm
The "-lm
" at the end of the command tells the
compiler to link to this library.
- There will be occasions where different parts of your program
will be in different files. For instance, you might have your
program in a file
junk.cpp
and you call a routine
in the file macheps.c
, then you can compile both
using g++ junk.cpp macheps.c
.
What? You don't have have a FORTRAN or C compiler on your
Microsoft operating system? There are several possible solutions:
Numerical Recipes is a great book, but it is not perfect.
Why you should not use Numerical Recipes?