CS 111: Introduction to Computational Science: Fall 2007
Introduction to scientific computing, emphasizing basic numerical algorithms
and the informed use of mathematical software.
Matrix computation, systems of linear and nonlinear equations,
interpolation and zero finding, differential equations, numerical integration.
Students will learn and use the Matlab language.
Instructor:
Prof. John R. Gilbert
Teaching assistant:
Adam Lugowski
Discussion and announcements:
Class meetings:
- Lecture: Monday and Wednesday 12:30-1:45, Trailer 387 (near Psych), room 101
- Discussion: Friday 2:00-2:50, Trailer 932
Textbook:
The textbook is:
Numerical Computing with Matlab,
by Cleve Moler.
The book has a
web site.
Besides the bookstore,
you can download the book from its web site,
or you can order it
from SIAM,
the Society for Industrial and Applied Mathematics.
You can get a discount on the book if you are a
member
of SIAM, which is free for UCSB students (talk to me).
Course software and computer resources:
You'll use Matlab for all your programming in the course.
It works on the Linux computers in CSIL and on the Windows
computers in the
ECI
labs.
To run Matlab from your personal machine, you can log in to CSIL remotely
and forward the graphics (instructions under construction),
or else buy a copy of the "student version" at the bookstore.
The course will also use the "NCM" software,
which you can put on your Matlab path at CSIL in any of several ways:
- at the Matlab prompt: addpath /cs/class/cs111/ncm
- in your startup.m file: addpath /cs/class/cs111/ncm
- when running Matlab: matlab -r "addpath /cs/class/cs111/ncm"
- bash command or put in ~/.bashrc: export MATLABPATH=/cs/class/cs111/ncm
- csh command or put in ~/.cshrc: setenv MATLABPATH /cs/class/cs111/ncm
For the ECI lab machines or your personal machine,
you can download your own copy of NCM from the
textbook web site.
Grades:
- Class participation: 15%
- Homework assignments: 40%
- Midterm exam: 15%
- Final exam: 30%
Midterm:
- Monday, November 5, in class
- Open book, open notes, no computers
- The midterm will cover chapters 1 and 2 of the text
and general knowledge of Matlab including indexing,
permutations, and so forth.
- The 2005 midterm.
(CS 111 was called CS 110A in 2005.)
Final exam:
- Noon - 3:00 pm, Wednesday, December 12, in classroom
- Open book, open notes, no computers
- The final will cover material from the entire course.
(See the list of topics.)
- The 2005 final.
(You can ignore questions 5 and 6, which are topics we
did not cover this year.)
Homework policy:
There will be a homework assignment every week.
You may talk to each other about the assignment, but what you submit
must be your own work.
Most weeks there will be two sets of problems:
one to be turned in for a grade,
and one for self-study to test your
own understanding of the course material.
All homework must be submitted in hard copy, on paper.
When a homework exercise requires a Matlab program, turn in four things:
- the program listing (m-files)
- the diary of your Matlab session running the program
- copies of any output figures or plots
- a description in English of what you did and how
Homework is due every Monday at the beginning of class, or in the CS111
homework box in the Computer Science mailroom, 2108 HFH, by 12:30 Monday.
No late homework will be accepted under any circumstances,
but I will drop your two lowest homework grades.
If you have questions about grading of homework, talk to the t.a. first.
If you are unable to reach an agreement, make an appointment to talk
to me. The statute of limitations for regrades is one week -- that is,
any requests for regrades must be made no later than one week after the
homework (or exam) was returned in class.
Homework assignments:
- Due Wed, Oct 3:
Do the review quiz.
Turn this in, Wednesday in class.
We will correct the quiz, but you will get full
credit just for turning it in.
Here is the answer key for the quiz.
- Due Mon, Oct 8: Exercises 1.1, 1.13, 1.15, 1.17.
(Turn these in for a grade, in class.)
- Due Mon, Oct 15: Exercises 2.1, 2.4, 2.8, 2.10
(Turn these in for a grade, in class.)
- Self study for Mon, Oct 15: Exercises 2.3, 2.7, 2.17
(Don't turn these in, they are to test your own understanding.)
- Due Mon, Oct 22: Exercises 2.5, 2.16(a), 2.16(b), 2.16(d),
2.22, 2.23, 2.26
(Turn these in for a grade, in class.)
- Self study for Mon, Oct 22: Exercises 2.12, 2.14, 2.25
(Don't turn these in, they are to test your own understanding.)
- Due Mon, Oct 29: Exercises 2.18, 1.34, 1.36, 1.38
(Turn these in for a grade, in class.)
- Self study for Mon, Oct 29: Exercises 2.15, 1.35, 1.39
(Don't turn these in, they are to test your own understanding.)
- Self study for Mon, Nov 5:
The 2005 midterm.
(No homework is to be turned in for a grade Mon, Nov 5.)
- Due Wed, Nov 14: Exercises 5.2, 5.3, 5.8
(Turn these in for a grade, in class.)
Hint for 5.3: Use the ``fzero'' function in Matlab.
- Due Mon, Nov 19: Exercise 5.11
(Turn this in for a grade, in class.)
See also the
NIST web page on this problem, and the
original 1967 paper on it.
Note: Some older versions of the book have different problem numbers in
Chapter 7. The following assignments are from the
current online version
of Chapter 7.
- Due Mon, Dec 3: Exercises 7.1 (standard form), 7.4 (erf),
7.16 (modified Lotka-Volterra), 7.17 (paratrooper).
Turn these in for a grade, in class.
- Self study for Mon, Dec 3: Do all the examples in Section 7.7,
pages 199-201, in Matlab (this won't take long).
Also, do exercises 7.3 (BS23) and 7.6 (stiffness).
Don't turn these in, they are to test your own understanding.
- Self study for the week of Dec 3:
Exercises 7.12 (Lorenz attractor) and 7.18 (cannonball).
Also please read exercise 7.21 (carbon dioxide),
and play with it if you'd like.
This is a long exercise, but it's a fairly realistic example of
the use of ODEs in climate change research.
Don't turn any of these in.
Reading assignments:
- Mon, Oct 1: Read Sections 1.1 through 1.6 of the text.
- Wed, Oct 3: Read Sections 2.1 through 2.7 of the text.
- Mon, Oct 8: Read Sections 2.8 through 2.12 of the text.
- Wed, Oct 17: Read Section 1.7 of the text, and
Trefethen's essay on numerical analysis.
- Mon, Oct 29: Read Sections 5.1 through 5.3 of the text.
- Tue, Nov 6: Read Sections 5.4 through 5.7 of the text.
- Wed, Nov 14: Read Sections 7.1 through 7.4 of the text.
- Mon, Nov 26: Read Sections 7.5 through 7.12 of the text.
- Wed, Nov 28: Read Sections 7.13 and 7.14 of the text.
(You won't be responsible for these sections on the exam,
but it's useful to see what the issues in error analysis are.)
Class schedule, links, slides, and diaries:
The schedule of future classes should be considered tentative!
Mon Oct 1: Introduction. The fractal fern.
[diary]
Wed Oct 3: Systems of linear equations.
[diary (you
will also need to put the file
temperature.mat
in your home directory)]
Mon Oct 8: LU factorization, pivoting.
[diary]
Wed Oct 10: Permutation matrices, permutation vectors, pivoting.
[diary]
Mon Oct 15: Guest speaker, Viral Shah: Parallel computing with graphs and matrices.
Wed Oct 17: Sparse matrices, graphs, and PageRank.
[slides;
class diary;
annotated diary of the whole PageRank computation
(you will need to put the file
ucsbweb2007.mat
in your home directory)]
Mon Oct 22: Error and residual, norm and condition number.
[diary]
Wed Oct 24: Floating-point arithmetic.
[diary]
Mon Oct 29: Wrapup of floating-point, error analysis for LU.
[diary]
Wed Oct 31: Least squares and curve fitting.
[diary;
censusdata.mat]
Mon Nov 5: Midterm.
Wed Nov 7: Least squares and curve fitting.
[diary;
censusdata.mat]
Mon Nov 12: (Veteran's Day, no class.)
Wed Nov 14: Orthogonal matrices and QR factorization.
[diary;
randq.m]
Mon Nov 19: Guest speaker, Viral Shah: HPC Challenge
Wed Nov 21: ODEs.
Mon Nov 26: ODEs: Standard form, Lotka-Volterra equations.
[diary;
f.m;
lotka.m]
Wed Nov 28: ODEs: Forward Euler and BS23 algorithms.
[diary;
weightf.m;
ode1.m]
Mon Dec 3: ODEs: Stiff problems.
[diary]
Wed Dec 5: All questions answered.
Wed Dec 12: Final exam, 12:00 to 3:00 pm.
Other things:
Nick Trefethen on
The
definition of numerical analysis
MIT's Math 18.06, an introductory course in linear algebra,
with Gil Strang's wonderful
lectures
online.