Math 373
Introduction to Scientific Computation
Fritz Keinert
Spring 2008

Announcements [old announcements]

Final grades have been submitted. You can look them up in WebCT.

You are welcome to come pick up your final homework. Email or call first to arrange a time when I will be in.

Have a great summer!

Homework

I will accept late homework until we discuss the answers in the following class, but you will lose 10% of your score for every day that the homework is late. I will post solutions to the homeworks, but not here. I will put them in WebCT, so that the search engines cannot find them.

Homework 1, due Thursday, February 14, 2008.

Homework 2, due Thursday, March 6, 2008

Homework 3, due Thursday, April 3, 2008

Homework 4, due Thursday, April 24, 2008 (data file for this homework)

Homework 5, due Friday, May 9, 2008 (data file for this homework)
Notes: You should do problems 3-6 in order. I will give more details and hints on problem 6 on the last day of class.

Syllabus

Afternotes

There is a famous book by Pete Stewart called "Afternotes In Numerical Analysis". For one semester he sat down after class and wrote out in detail what he just did, and then he had a book. There is also a sequel called "Afternotes Goes To Graduate School", or something like that. I am not going to such lengths, but I will at least put down a few key words on what we covered each class period, and what the relevant sections in the book are.

For past dates: Let me know if I forgot something. For future dates: all information is tentative.

Tuesday, January 15
  • Overview of course organization and course topics
  • Taylor's theorem (one-dimensional version)
  • IEEE arithmetic: integers, floating point numbers, double precision numbers
  • Absolute error, relative error, error propagation, cancellation

Read appendix A2.1, A2.2
Old lecture notes: Chapter 2: Computer Arithmetic and Computational Errors

Thursday, January 17
  • The machine epsilon
  • The condition number of a problem and an algorithm
  • Review of linear algebra (vectors and matrices)

Read appendix A1
Old lecture notes: Chapter 2: Computer Arithmetic and Computational Errors

Tuesday, January 22 Class meets in computer lab Carver 449 instead of our classroom

Start reading chapter 1. Alternatively, find a MATLAB tutorial on the web, and read that.

Thursday, January 24

More about linear algebra :

  • inverse matrix
  • eigenvalues and characteristic equation
  • special types of matrices: diagonal, tridiagonal, banded, triangular, Hessenberg, symmetric, orthogonal

Finish reading chapter 1, or whatever tutorial you are using. Play around with MATLAB.

Tuesday, January 29

Start Topic 2: Linear Algebra

  • A system of m equations in n unknowns is equivalent to a matrix equation Ax = b.
  • Standard approach to all numerical analysis problems:
    1. Does the mathematically exact problem have a unique solution? If not, add more conditions until it does
    2. Find an algorithm
    3. Find an error estimate for the algorithm
  • Answer to 1: A unique solution for all right-hand sides b exists if and only if A is square (m = n) and nonsingular. We will assume that from now on.
  • Answer to 3: The only source of error in this situation is round-off error, which can be estimated from the condition number. The condition number is norm(A) · norm(A-1), both for changes in the right-hand side b and changes in A.
  • relevant MATLAB functions: A/B and A\B, inv(A), cond(A), rcond(A)

Read 2.1 - 2.4. You can skip the parts of 2.2 that deal with rank-deficient systems. We will come back to that later.
Old lecture notes: Chapter 3: Linear Systems of Equations

Thursday, January 31

Gaussian Elimination

  • We now tackle item 2. from the list above: Find an algorithm. The standard approach to deriving algorithms for most linear algebra problems is this:
    1. Identify types of matrices for which the problem is easy to solve
    2. Identify allowed operations which will not change the solution
    3. Figure out how to use allowed operations to reduce the original problem to one of the easy cases
  • The answers for the case of solving Ax = b are
    1. Triangular matrices
    2. Elementary operations: scale a row, add a multiple of one row to another, interchange rows
    3. Gaussian Elimination

Read 2.5, 2.6.
Old lecture notes: Chapter 3: Linear Systems of Equations

Tuesday, February 5

More on Gaussian Elimination

  • The need for pivoting, to avoid zero pivots and to improve stability
  • Gaussian elimination is equivalent to factorization A = L ·U

The Cholesky algorithm

  • If A is symmetric, positive definite, it can be factored as A = L · LT
  • If A is symmetric, it can be factored as A = L ·D· LT

Read 2.7, 2.8
Old lecture notes: Chapter 3: Linear Systems of Equations

Thursday, February 7

Final remarks on Gaussian Elimination

  • Very well suited for banded matrices (O(n) operations)
  • Solving matrix equations AX = B, especially AX = I to find X = A-1
  • We don't actually need A-1. Ever.

QR factorization

  • Definition of QR, full versus reduced QR factorization
  • Gram-Schmid orthonormalization algorithm produces reduced QR
  • Other algorithms (Givens rotations, Householder matrices) produce full QR
  • Pivoting can be used to sort diagonal elements in R by size (and produce trapezoidal partition of R, instead of triangular)
  • Use QR to find rank, nullspace and range of matrix

Read 2.9 if you want. Mostly it describes the Householder algorithm, which I did not cover in class.
Old lecture notes: Chapter 6: Linear Least-Squares Data Fitting

Tuesday, February 12

Least Squares Problems

  • Source of problems, examples
  • Solving them by Normal Equations
  • Solving them by QR
  • Solving them by SVD

More on the Singular Value Decomposition

Read 2.10, 2.11, 2.12. Skip the rest of chapter 2.
Old lecture notes: Chapter 6: Linear Least-Squares Data Fitting

Thursday, February 14

Class meets in computer lab Carver 449 instead of our classroom

Homework 1 due

Linear Algebra in Matlab: Examples and demonstrations (my notes)

Tuesday, February 19

Start Topic 3: Nonlinear Equations and Optimization

  • Overview of one-dimensional case
    • direct versus iterative methods
    • root finding versus optimization (finding max or min)
    • order of an iterative method
  • the bisection method
  • fixed point iteration

Read 3.1 — 3.4.
Old lecture notes: Chapter 7: Solution of Nonlinear Equations

Thursday, February 21

More on solving nonlinear equations:

  • fixed point iteration (continued)
  • Newton's method

Read 3.5, 3.7. Skip 3.6.
Old lecture notes: Chapter 7: Solution of Nonlinear Equations

Tuesday, February 26

More on solving nonlinear equations:

  • secant method
  • why secant is better than Newton's method
  • routine fzero in Matlab does a combination of bisection and secant

Overview of optimization:

  • golden section search (similar to bisection)
  • Newton's method (same as the other Newton's method for f = F')
  • parabolic interpolation (similar to secant)

Old lecture notes: Chapter 9: Optimization and Nonlinear Least Squares

Thursday, February 28

Aitken Δ2 extrapolation

A quick survey of higher-dimensional root finding and optimization:

  • Review of multivariable calculus
  • Methods for root finding: fixed point iteration, Newton's method, quasi-Newton methods
  • Methods for optimization: direction search methods

Old lecture notes: Chapter 9: Optimization and Nonlinear Least Squares

Tuesday, March 4

Class meets in computer lab Carver 449 instead of our classroom

  • Interacting with a script (input, keyboard, debugging commands)
  • Formatting output (disp, num2str, sprintf)
  • Passing functions as parameters (eval, feval)
  • Equation solving and optimization (fzero, fminbnd, fminsearch)
  • Passing extra arguments (global)

My notes

Thursday, March 6

Start Topic 4: Data Fitting

Homework 2 due

  • Interpolation versus Approximation
  • Evaluating polynomials: Horner scheme
  • Different representations: powers of (x - x0) instead of powers of x, or sum of Lagrange polynomials
  • Polynomial Interpolation
    • using system of linear equations
    • Lagrange polynomials

Read 7.2
Old lecture notes: Chapter 4: Interpolation

Tuesday, March 11 More on polynomial interpolation:
  • Newton's interpolation method
  • Error term and instability of high degree polynomial interpolation (Runge example)
  • Some example(s) for estimating the accuracy

Read 7.2
Old lecture notes: Chapter 4: Interpolation

Thursday, March 13

Piecewise polynomials (splines)

Read 7.3
Old lecture notes: Chapter 4: Interpolation

Tuesday, March 25
  • Review of polynomial and spline interpolation
  • More on splines (if necessary)
  • Review of least squares approximation
  • Nonlinear least squares
Thursday, March 27

Fourier analysis

Read 7.4

Tuesday, April 1

Class meets in computer lab Carver 449 instead of our classroom

My notes

Thursday, April 3

Nonlinear Least Squares

Homework 3 due

Tuesday, April 8

Quick overview of numerical differentiation and integration

Read 4.1-4.6 (optional)

Thursday, April 10

Review of ODE theory

Overview of numerical methods for ODEs

Read 5.1, 5.14, or 8.1 in my notes

Tuesday, April 15

Numerical Solution of ODEs

  • Taylor series methods
  • local and global error

Read 5.2, 5.3, or 8.4 in my notes

Thursday, April 17

Numerical Solution of ODEs

  • Runge-Kutta methods

Read 5.5, or 8.19 in my notes

Tuesday, April 22

Numerical Solution of ODEs

  • multistep methods = predictor/corrector methods
  • accuracy and stability

Read 5.4, 5.6, or 8.9 in my notes
Note: the trapezoidal method covered in 5.4 is a one-step implicit multistep method

Thursday, April 24

Numerical Solution of ODEs

  • shooting methods for boundary value problems
  • methods for stiff ODEs

Read 5.15.

Homework 4 due

Tuesday, April 29

Class meets in computer lab Carver 449 instead of our classroom

My notes

Thursday, May 1

Review

Discussion of final homework

Friday, May 9,
9:45-11:45am

Homework 5 due

Old Announcements

  • Tuesday, March 4: I will be out of town after Wednesday, March 5, until the middle of spring break. Prof. Roger Alexander will be teaching for three class periods. He is not going to grade your homework, however, so that will have to wait until I get back. The new homework will be posted before I leave.
  • Tuesday, March 4: As an unfortunate side effect of this, I will have to base the midterm grades on the first homework alone. Midterm grades are only reported if your current standing is C- or worse. If that is the case, I will contact you directly.
  • Tuesday, March 4: I have decided to post my old lecture notes, on which many of my examples in class are based. They are based on a different textbook, and I haven't updated them in 15 years, but maybe you can still get something out of them.
  • Thursday, Jan 24: Representatives from MathWorks will be on campus February 5 for Matlab training, but their schedule is not compatible with out class. Check out the details and sign up if you are interested, but we will have class as usual that day.
  • Thursday, Jan 24: The Academic Success Center is looking for tutors for 100-level math classes, especially for 160, 181 (both calculus) and 201 (Intro to Proofs). Check out their flier, and contact them if you are interested.
  • Tuesday, Jan 15: Someone asked about a CD that is supposed to come with the book. It turns out that you can download it from the MathWorks web site (makers of MATLAB), not the book web site. I have put a local copy here. It is only 74K, and contains a bunch of MATLAB subroutines and data that is referenced in the book and/or the homework problems. I am not sure if we are going to use them or not.
  • Tuesday, Jan 15: I mentioned in class that there is a place where students can download MATLAB for their personal machines. Tony found it: http://www.it.iastate.edu/sldb/view.php?id=21.

Last Updated: May 12, 2008