Foundations of Scientific Computing
Foundations of Scientific Computing - CS110A
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.
John R. Gilbert
Office: Phelps 3220
Office Hours: see my home page
Office: Phelps 3218
Office Hours: Fridays, 1:00pm-2:00pm, and again at 3:00pm-4:00pm in CSIL
There is a Google discussion group for the class at
All students are expected to join this group and to watch it for
course announcements. You may also use it to post questions (of general
interest to the class) for the instructor and t.a. The mailing address
for posting to the group is
- Lecture: MWF 9:00-9:50, Broida 1640
- Discussion: F 11:00-11:50 (Code 08201), Phelps 1425
- C. B. Moler, Numerical Computing with MATLAB.
The textbook is
or you can order it in paperback from
the Society for Industrial and Applied Mathematics.
You can get a discount on it if you are a member of SIAM.
If you want to join SIAM, let me know; there are some
free student memberships
Matlab works on the Linux computers in CSIL and ECI 1. Here is a map of the labs. You might need to add the following line to your .bash_profile (for bash shell) or .cshrc (for csh shell) to
make sure that the license manager can be located.
- Bash shell: export LM_LICENSE_FILEemail@example.com
- Csh shell: setenv LM_LICENSE_FILE firstname.lastname@example.org
NCM, software for the course:
In MATLAB running on the Linux machines on the UCSB Engineering Network, issue the command:
>> addpath /cs/class/cs110a/ncm
or install your own copy:
Homework: 50%, Midterm: 20%, Final: 30%
Friday, Feb. 4, in class.
Open book, open notes, no computers.
The midterm will cover Sections 1.3, 1.7 and all of
Chapter 2 of the text, as well as general knowledge of Matlab
at the level of Chapters 1 and 2.
8:00 - 11:00 am (sigh), Wednesday, March 16
Open book, open notes, no computers.
The final will cover material from the entire course:
There will be a final exam review in the regular discussion
section, Friday, March 11, 11:00 - 11:50, Phelps 1425.
A sample final has been prepared and is posted here.
An excellent test preparation is to print out the problems (without looking at the solution), and try to solve the problems in under 3 hours.
For the curious, it consists of the following problems:
- general knowledge of Matlab
- indexing and permutations
- floating-point arithmetic
- linear equation systems
- LU factorization
- Cholesky factorization
- zero finding
- least-squares data fitting
- ordinary differential equations
- Problem 1 from the 2004 final (on Floating Point)
- Problem 2 from the 2004 final (LU factorization)
- Problem 3 from the 2004 final, slightly modified (norms and ill-conditioning).
- Problem 4 from the 2004 final, slightly modified.
- Problem 5 from the 2004 final (interpolation multiple choice)
- Problem 7 from the 2004 final (one BS23 step)
- Problem 3 from your midterm test.
- A Multiple choice problem
- Text problem 7.1, (setting up an ODE in standard form) slightly modified
- A least squares problem
Exams from earlier years:
Answers to Midterm, 2003.
Questions and answers to Final, 2004.
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.
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 CS110A homework box in the Computer Science
copy room, 2108 Eng I, by 9am Monday.
No late homework will be accepted under any circumstances,
but I will drop the two lowest of your 9 homework grades.
(Early homework is fine :-)
Due Mon, Jan. 10: Exercises 1.13, 1.15, 1.17, 1.34, 1.39
Due Wed, Jan. 19: Exercises 2.1, 2.4, (2.5), 2.8, 2.10, (2.14)
(Note: The due date for 2.5 and 2.14 is moved to Mon, Jan. 24)
Due Mon, Jan. 24: Exercises 2.5 (again), 2.11, 2.14 (again), 2.18
Due Mon, Jan. 31: Exercises 2.21, 2.22, 2.23, 2.26, and
(Due date extended to Wed, Feb. 2 because of CSIL closure)
Due Mon, Feb. 7: Exercises 3.2, 3.3, 3.4
Self-study for Mon, Feb. 14: Exercises 4.1, 4.2a-c, 4.8
(don't turn these in, but I recommend doing them for yourself to
test your understanding.)
Due Mon, Feb. 14: Exercises 4.3, 4.14, 4.16 (Do turn these in.)
Due Wed, Feb. 23: Exercises 5.2, 5.3, 5.8 (Do turn these in.)
Self-study for Mon, Feb. 28: Exercises 5.5, 5.7 (Don't turn these in.)
Due Mon, Feb. 28: Exercises 5.11, 7.1 (Do turn these in.)
Note: The exercises in Chapter 7 are numbered differently in the
online version of the book and in the SIAM paperback.
The following assignments are from the online version.
Self-study for Mon, Mar. 7:
Online book Exercises 7.1 (BS23), 7.5 (four ODE's), 7.14 (paratrooper).
Don't turn these in.
Due Mon, Mar. 7:
Online book Exercises 7.2 (erf), 7.13 (modified Lotka-Volterra),
7.18 (carbon dioxide). Do turn these in.
Mon, Jan. 3: Read Chapter 1 of the text, and Trefethen's
Fri, Jan. 5: Read Sections 2.1 through 2.7 of the text.
Fri, Jan. 12: Read Sections 2.8 and 2.9 of the text.
Wed, Jan. 19: Read Sections 2.10, 2.11, and 2.12 of the text.
Wed, Jan. 26: Read Sections 3.1 through 3.5 and 3.7 of the text.
Wed, Feb. 2: Read Sections 4.1 through 4.6 of the text.
Mon, Feb. 7: Read Sections 4.7 through 4.10 of the text.
Fri, Feb. 11: Read Sections 5.1 through 5.3 of the text.
Wed, Feb. 16: Read Sections 5.4 through 5.7 of the text.
Fri, Feb. 18: Read Sections 7.1 through 7.4 of the text.
Wed, Feb. 23: Read Sections 7.7, 7.8, and 7.12 of the text.
Mon, Feb. 28: Read Sections 7.5, 7.6, 7.10, 7.11, and 7.14 of the text.
Wed, Mar. 2: Read Sections 7.9 and 7.13 of the text.
Jan. 3: Fractal fern
Jan. 7: Floating-point numbers
Jan 10: Linear systems and LU factorization
Wed, Jan 12: LU decomposition
Jan 14, and following: Linear systems and LU factorization
Jan 24, and Wed, Jan 26: Sparse matrices
Feb 7 and Wed, Feb 9: Finding zeros
Mon, Jan. 3
Wed, Jan. 5
Fri, Jan. 7
Mon, Jan. 10
Fri, Jan. 14
Wed, Jan. 19
Fri, Jan. 21
Mon, Jan. 24
(For this diary you will also need to put the file
temperature.mat in your Matlab directory.)
Wed, Jan. 26 diary,
Fri, Jan. 28
Mon, Feb. 7
Wed, Feb. 9
Fri, Feb. 11
(File censusdata.mat is here, or in the ncm directory.)
Wed, Feb. 16
Fri, Feb. 18
Wed, Feb. 23
Fri, Feb. 25
Mon, Feb. 28
Wed, Mar. 2
Fri, Mar. 4
Mon, Mar. 7
Nick Trefethen on
definition of numerical analysis
MIT's Math 18.06, an introductory course in linear algebra,
with Gil Strang's wonderful