AM9561, Graduate Introductory Numerical Methods
Autumn 2012
Rob Corless
Middlesex College Room 272
Meeting Times
 Midterm TBA
 (Lab) location/times TBA, hopefully in Tuesdays 14:3016:20
 (Lectures) Mondays 2:303:20, T Th 12:3013:20 in MC204
TA: Piers Lawrence
Course Textbook:
A Graduate Introduction to Numerical Methods and Backward Error,
By Rob Corless and Nic Fillion, to be published by Springer
Resources
Topics so far
 Notes for November 29, 2012
 Notes for November 27, 2012
 Notes for November 26, 2012
 Notes for November 22, 2012
 Notes for November 20, 2012
 Notes for November 19, 2012
 Notes for November 15, 2012
 Notes for November 13, 2012
 Notes for November 12, 2012
 Notes for November 8, 2012
 Notes for November 1, 2012
 Notes for October 30, 2012
 Notes for October 29, 2012
 Notes for October 22, 2012
 Notes for October 18, 2012
 Notes for October 15, 2012
 911.10.2012 Updated interpolation notes and other old notes
 Notes for October 2, 2012
 Notes for October 1, 2012
 Notes for Sept 27, 2012
 Notes for Sept 25, 2012
 Notes for Sept 24, 2012
 Notes for Sept 20, 2012
 Notes for Sept 18, 2012
 Notes for Sept 17, 2012
Maple Worksheets
These worksheets are displayed here in web format, using MathML 2.0 which your
browser ought to recognize... Let me know. Ok, this seems to have failed utterly. I put links now to pdf versions.
Old course material below this line
Assignments
Assignment 2 .pdf version Deadline extended till Monday 15.11.10.
 Assignment 1 (worth 5% of your mark). .pdf version , and the LaTeX source , which you
will need for question 8.
 Assignment 0 (not for credit) Write a short description of your scientific
background and interests. Include contact email for inclusion in
the course mailing list.
Labs
Topics so far
2009 Course Lectures Tuesday and Thursday 9:3010:30 MC204
Computer Lab Tuesday 12:3013:30 North Campus Building 105
In the scheduling meeting we had discussed a preference for the
time 13:3014:30, but balancing different needs I chose this time.
Office Hour: Thursday 10:3011:30 (right after class)
TA Office Hour: Monday 11:30, MC 275B or Rotunda. (Roman Naryshkin)
Midterm
SSC 2110
has been booked for your AM 9561 midterm on Thursday, November 5 from 5:00 to 7:00pm.
Topics: Condition numbers in all contexts: arithmetic, matrix eigenproblems,
solution of linear systems of equations, interpolation, quadrature.
NEW : Results are in. Exams handed back 10.11.2009.
Solutions
Extension to Assignment 2
Several people have requested more time for Assignment 2. I will at least
extend the deadline till Thursday, and we will discuss tomorrow if it makes
sense to extend it till next Tuesday. This will be announced also by email
(I have finally created the class mailing list). Assignment 1 has now
been marked (..except I am doublechecking that all of them got marked)
and so you should get them back soon.
Resources
Assignments
 Assignment 4 (worth 5% of your mark). .pdf version . Helper files first.m and second.m and the file mypoisson.m .
 Assignment 3 (worth 5% of your mark). .pdf version due Tuesday November 16, 2009.
For interest, .tex source and I have
updated the .bib file in the link below. For those of you who wish to use
 Assignment 2 (worth 5% of your mark). .pdf version due Tuesday October 20, 2009.
For interest, .tex source and I have
updated the .bib file in the link below. For those of you who wish to use
Maple partly for this assignment, I include a helpful command below.
V := Matrix(7, 7, shape = Vandermonde[[tau[0], tau[0], tau[1], tau[1], tau[1], tau[2], tau[2]], confluent = true]);
 Assignment 1 (worth 5% of your mark). .pdf version , and the LaTeX source , which you
will need for question 8. Oh, yes, the .bib file , too.
 Assignment 0 (not for credit) Write a short description of your scientific
background and interests. Include contact email for inclusion in
the course mailing list. Due 17.9.2009.
Tutorials
 31.11.2009 FFT and free time for Assignment
 24.11.2009 Delay differential equations:
Shampine, Thompson and Kierzenka tutorial
 10.11.2009 Stiff solvers and BVP solvers (time permitting)
 3.11.2009 Residuals by DEVAL, odeexamples
 no tutorial 13.10.2009
 6.10.2009 Sparse Matrix Stuff GaussSeidelIter.m , JacobiIter.m , eigIM.m , cost.m and Seneca.m.
This new version of Seneca.m and GaussSeidelIter.m can be used to
look at GaussSeidel iteration as follows. I include a parameterization
by a global variable theta (I got tired of changing all the 2.1 etc's to 10)
global theta;
theta = 2.1;
n = 100;
b = rand(n,1);
x = b;
for i=1:100,
x = GaussSeidelIter( b, x );
end;
norm( b  Seneca(x), 1 )
yields 0.0025 on my machine.
 28.9.2009 svdgraphs in matlab, svdgraphs in Maple
Topics so far
 31.11.2009
dft.mw (Maple) Discrete sine transform,
dft2.mw (Maple) Discrete cosine transform,
dftdem.m (Matlab) fft,
powerdem.m (Matlab) periidogram or power spectrum.
 14.11.2009 and 26.11.2009 Delay Diiferential Equations. See the help for dde23, the
tutorial at
the Mathworks,
and the Shampine & Thompson 2001 paper
%A Shampine, L.F.
%A Thompson, S.
%D 2001
%I Elsevier Science
%J Applied Numerical Mathematics
%K
%N 4
%P 441458
%T Solving DDEs in Matlab
%V 37
%W /cgibin/sciserv.pl?collection=journals&journal=01689274&issue=v37i0004&article=441_sdim
%X We have written a program, dde23, to solve delay differential equations (DDEs) with constant delays in Matlab. In this paper we discuss some of its features, including discontinuity tracking, iteration for short delays, and event location. We also develop some theoretical results that underlie the solver, including convergence, error estimation, and the effects of short delays on stability. Some examples illustrate the use of dde23 and show it to be a capable DDE solver that is exceptionally easy to use.
%0 Article
%8 June, 2001
%@ 01689274
See also Larry's current work. In particular, we will use
his overlays that he presented at the meeting in the Yucatan:
Read1.pdf and
Read2.pdf with K.Cooke and
P van den Driessche. More:
J. M. Heffernan & Robert M. Corless, \Solving some delay
differential equations using
computer algebra", the Mathematical Scientist 31, no. 1, (2006) pp. 2134.
 17/20.11.2009 Guest lectures by Prof. David Jeffrey: Remote Computing
 10/12.11.2009Stiff differential equations, BoundaryValue Problems,
DifferentialAlgebraic Equations, and more.
 3/5.11.2009
AM 9561 Numerical Solution of ODE
.
 27/29.10.2009 AM 9561 Functions and Rootfinding
 15.10.2009 More on Interpolation and Approximation.pdf and interpolationII.pdf and
 genbarywts.m
 hermiteval.m
 runge2example.m
 rungex.mw (Maple worksheet)
 rungehip.mw (another one)
 BHIP.mpl (Maple source code)
 13.10.2009 Notes on interpolation and a Maple worksheet
 diary from today 8.10.2009
 6.10.2009 and 8.10.2009.
Sparse and structured linear systems. Moler 2.10 and supplementary material. cost.m and Seneca.m.
 29.9.2009 and 1.10.2009 Notes from last year
 24.9.2009 Class notes (if you wish a
copy, please ask Audrey: don't print yourself, except at home if you like)
 22.9.2009 Introduction to the SVD (Singular Value Decomposition): Material
from Chapter 2 of Matrix Computations, by Golub and Van Loan.
 Matlab commands from Sept 17, 2009
Old course material from 2008 and earlier below this line
Course Lectures 2008 Monday 9:3011:30 MC204
Final Exam
The final exam will take place in HSB 13, Monday Dec 8, 9:00AMnoon.
The computers will allow you to use Matlab but not email or web browsing.
After you finish the exam, email will be turned back on and you can send me
your results.
The tutorial Tuesday December 2 will be a "dry run" of the software, with a prototype question.
Course Text and other online references
On the Midterm
The midterm will take place in MC 204, Monday November 3, 2008,
from 7:00pm until 10:00pm. Extra time will be available for those who
need it (some of the questions take a long time to state, and so if
English is your second (or third or fourth) language, maybe it's reasonable
to take a little extra time to read them. I believe, though, that
the questions themselves are straightforward to do, once you've
read them.
Calculators or computers will not be necessary. The exam is
closedbook, so no notes or text either.
I hope to have your assignments marked by the end of tomorrow, so
you may have them back on the weekend to look at.
Observations on the assignment
The midterm material is directly from my notes and from Moler's book,
though the problems may involve new situations for what you have learned.
The topics covered are: (in six multipart questions in this order)
 Floatingpoint arithmetic
 Numerical Linear Algebra
 Interpolation and LeastSquares Approximation
 Quadrature
 Finite Differences
 Rootfinding
Tutorials on Matlab and LaTex
Tuesdays 9:30am, North Campus Building 105
 Found them...
 11.11.2008 Residual Example
 28.10.2008 ode solving Threebody problem. orbitodejac.m
 21.10.2008 more on rootfinding: basins of attraction.
 14.10.2008 Guest Tutorial, Prof. David Jeffrey, Chair, Dept. Applied Mathematics. Office Hours Postponed.
 30.9.2008
Kahan on quadrature and my version of Kahan's proof that quadrature is impossible. Also, transcript of the Matlab session 29.9.2008.
 23.9.2008 svdgraphs in matlab
Upcoming Lectures
 FFT (Moler 8, fourier.pdf) and PDE (Moler 11, pdes.pdf)
Assignments
 Assignment 4:
Conditioning
. Helper files first.m and second.m.
 Assignment 3: Rootfinding and ODEs
Due 10.11.2008. If you get this today, ask Audrey or Karen for a printout,
don't print it yourself
 (draft version 2.0) Assignment 2, Due 20.10.2008
Possible transcription error in B coefficients? Two students
have reported a potential problem with the compact finite difference
question. Here is a (Maple) code fragment: you can check the numbers
here.
c := 2.0 + sqrt(3.0);
alpha := 1.0/c;
b := Array(0..n); # same as u
b[0] := ((25*c+3)*u[0] + (48*c10)*u[1] + (1836*c)*u[2] + (16*c6)*u[3]
+(13*c)*u[4] )/12/h;
for k to n1 do
b[k] := 3*(u[k+1]u[k1])/h;
end do;
b[n] := (11*u[n4]  58*u[n3] + 126*u[n2]  182*u[n1] + 103*u[n])/12/h;
 genbarywts.m
 hermiteval.m
 runge2example.m
 Assignment 1, Due 29.9.2008
 Assignment 0 (not for credit) Write a short description of your scientific
background and interests. Due 15.9.2008.
Topics so far
 Large Systems and the Method of Lines
pages 114125 of Shampine, Gladwell and Thompson,
"Solving ODES with Matlab, Cambridge 2003.
onewaywave.m and its driver:
>> t=0:0.3:8;
>> n=256;
>> x=linspace(0,2*pi,n+1);
>> u0=exp(100*(x1).^2);
>> [t,slices]=ode23(@onewaywave,t,u0);
>> mesh(x,t,slices),view(10,70),axis([0,2*pi,0,8,0,5])
 10.11.2008 Delay Diiferential Equations. See the help for dde23, the
tutorial at the Mathworks, and the Shampine & Gordon 2001 paper
%A Shampine, L.F.
%A Thompson, S.
%D 2001
%I Elsevier Science
%J Applied Numerical Mathematics
%K
%N 4
%P 441458
%T Solving DDEs in Matlab
%V 37
%W /cgibin/sciserv.pl?collection=journals&journal=01689274&issue=v37i0004&article=441_sdim
%X We have written a program, dde23, to solve delay differential equations (DDEs) with constant delays in Matlab. In this paper we discuss some of its features, including discontinuity tracking, iteration for short delays, and event location. We also develop some theoretical results that underlie the solver, including convergence, error estimation, and the effects of short delays on stability. Some examples illustrate the use of dde23 and show it to be a capable DDE solver that is exceptionally easy to use.
%0 Article
%8 June, 2001
%@ 01689274
See also Larry's current work.
For examples in dynamical systems and biology, see Xingfu Zou's page, and in
particular the wonderful paper
with K.Cooke and
P van den Driessche. More:
J. M. Heffernan & Robert M. Corless, \Solving some delay
differential equations using
computer algebra", the Mathematical Scientist 31, no. 1, (2006) pp. 2134.
 3.11.2008 Stiff differential equations, BoundaryValue Problems,
DifferentialAlgebraic Equations, and more.
 27.10.2008
AM 9561 Numerical Solution of ODE
. Please ask Audrey for a copy rather than printing on Monday:
copies are cheaper. She will have them shortly after 9. Feel free to print
on your own printer, of course, though if you can avoid it entirely so much
the better.
 20.10.2008 AM 9561 Functions and Rootfinding
 6.10.2008. Forgot to post this last week! On conditioning of evaluation and interpolation. Today's planned lecture:
Numerical differentiation and finite differences..
See also An image of a talk I gave at CAIMS 2005. Here is the Maple Worksheet used to generate it, and the underlying Maple code.
Matlab programs:
 fdererror.m
 polyder.m
 fderrlog.m
 29.9.2008. (version 2.0 draft) Interpolation and approximation.
 22.9.2008.
Sparse and structured linear systems. Moler 2.10 and supplementary material. cost.m and Seneca.m.
 15.9.2008. The SVD, least squares, and the solution of linear systems.
Chapters 10, 5, and 2 of Moler. See also
a Maple worksheet exploring the geometry of the SVD.
 The Gauss map

Introduction, FloatingPoint, necessity, complexity, stability.
 Matlab diary Sept 8, 2008
Material from previous years
David Jeffrey's web page for AM561