Introduction to Numerical Analysis
Instructor: Homer Reid
View this document in PDF form: Overview.pdf
Lectures: 2:30--4 pm, Tuesday / Thursdays, 2-105 PSets, Exams, etc: Approximately weekly PSets. Two in-class midterms. No final exams. Final project worth 25% of grade. Grading: 25% homework, 25% midterm 1, 25% midterm 2, 25% final project. Office hours: TBD
Note: At some point during the first two weeks of class I will hold special office hours for the purpose of ensuring that everybody is up and running with the programming language of your choice. Bring your laptop and we'll work through any issues you might be having. Stay tuned for the time, date, and place.
This course is an exploration of the art and science of extracting numbers from mathematical expressions. The material we will cover may be broadly divided into two units.
Unit 1 is all about basic numerical calculus. We will discuss elementary methods for obtaining accurate numerical estimates of integrals, derivatives, and infinite sums. This unit will include discussions of extrapolation, interpolation, root-finding, optimization, and evaluation of special functions. By the end of Unit 1, you will be in a position to implement and understand the properties of the most basic numerical methods for all of these tasks. However, in several places during the course of the elementary treatment of Unit 1, we will encounter phenomena that seem to be hinting at a deeper set of ideas.
This will set the stage for Unit 2 of our course, Fourier analysis and spectral methods. The overarching theme here is that we can often revolutionize the speed and accuracy of a calculation by approximating a function as an expansion in some convenient set of expansion functions -- often a set of orthogonal functions. Our discussion of orthogonal-function expansions will begin, as must any, with the granddaddy of them all: the Fourier series and its immediate descendants (the Fourier transform, Parseval's and related theorems, the FFT, etc.). Then we will broaden the setting to consider more general classes of functions and more general spectral methods: Gaussian quadrature, Chebyshev polynomials and Trefethen's
chebfun,Nystrom solution of integral equations, and more.
Throughout Units 1 and 2 we will pepper the discussion with examples drawn from engineering and the sciences, including binding energies of solids, coding and modulation schemes for efficient use of the wireless communications spectrum, spherical Bessel functions for electromagnetic scattering and thermal engineering, and Ewald summation. The course will also include bird's-eye views of topics treated more thoroughly in other courses, such as numerical linear algebra, PDE solvers, and stochastic and Monte-Carlo methods.
This is a rough schedule of the topics we will discuss and the order in which we will discuss them. The midterm dates will not change, but the order of some topics and the time we allocate to them may shift as the semester progresses.
|2/5/2015||Thursday||Evaluation of infinite sums. Numerical integration of functions: Newton-Cotes quadrature. Application to improper integrals.|
|2/10/2015||Tuesday||Heuristic convergence analysis of Newton-Cotes quadrature.|
|2/12/2015||Thursday||Numerical integration of ODEs. Reduction of high-order ODEs to first-order form. Euler's method.|
|2/19/2015||Thursday||Numerical integration of ODEs: Beyond Euler's method. Convergence analysis of the improved Euler method. Runge-Kutta methods. Adaptive stepsizing.|
|2/24/2015||Tuesday||Pathologies in ODE solvers: Stability, stiffness, and implicit methods. Pathologies in ODEs themselves: non-uniqueness and non-existence. Boundary-value problems; shooting methods. The beam equation.|
|2/26/2015||Thursday||Richardson extrapolation. Numerical differentiation: finite-difference stencils. Finite-difference approach to boundary-value problems.|
|3/3/2015||Tuesday||Computer representation of numbers: fixed- and floating-point arithmetic. Exactly representable numbers and rounding errors. Catastrophic loss of floating-point precision.|
|3/5/2015||Thursday||Computer representation of numbers: Accumulation of rounding errors. Numerical stability of forward and backward recurrence relations for special functions. Numerical root-finding: Sample problems and 1D methods.|
|3/10/2015||Tuesday||Convergence of Newton's method. Newton's method in higher dimensions.|
|3/12/2015||Thursday||Unit 1 summary and midterm review.|
|3/31/2015||Tuesday||Fourier analysis: The fourfold way. Parseval, Plancherel, and Poisson formulas.|
|4/2/2015||Thursday||Paley-Wiener theorems. Convolution. Fourier series.|
|4/7/2015||Tuesday||Applications of Fourier analysis, Part 1: Modulation. Wireless communications and lock-in amplifiers. Spectral efficiency of telecommunications coding schemes.|
|4/9/2015||Thursday||Applications of Fourier analysis, Part 2: Ewald summation.|
|4/14/2015||Tuesday||Fourier analysis in higher dimensions. Applications of Fourier analysis, Part 3: Rigorous convergence analysis of Newton-Cotes quadrature.|
|4/16/2015||Thursday||Clenshaw-Curtis quadrature. Discrete Fourier transforms.|
|4/23/2015||Thursday||Final project proposal due. Applications of Fourier analysis, Part 4: the FFT and its uses. Signal processing, arbitrary-precision arithmetic, discrete convolution, PDE solvers.|
|4/28/2015||Tuesday||Chebyshev polynomials. Chebyshev interpolation and differentiation.|
|4/30/2015||Thursday||Orthogonal polynomials. Gaussian quadrature. Integral equations. Nystrom's method.|
|5/5/2015||Tuesday||Unit 2 summary and midterm review|
|5/12/2015||Tuesday||Numerical linear algebra revisited. Dense-direct and sparse-iterative methods. Bird's-eye overview of numerical PDE solvers.|
|5/14/2015||Thursday||Numerical nonlinear algebra: Resultants and tensor eigenvalues.|
The PSets and the final project will require you to write simple computer programs. You may use any programming language you like, but we particularly recommend one of three choices: c (or c++), matlab, or julia.
If you are not sure which language to use, here are some thoughts to help guide your decision.
The c programming language, and its close cousin c++, are the most widely used programming languages in the world. Programming in these languages offers you maximal flexibility in using your computer's resources. c/c++ programs run significantly faster than programs written in matlab, python, or other languages. Moreover, almost every useful piece of software out there in the world that you might want to tie into your software is available in c/c++ form, so this option offers you the widest range of interoperability with existing codes. If you are planning to do much programming or to work with existing codes in your future, I strongly recommend you acquire at some point at least a working familiarity with c/c++. However, if you have not done much or any c/c++ programming, you may experience a rather steep learning curve, and you may not wish to make that time investment for 18.330.
matlab is a common choice for academic numerical programming. It is much easier to get started programming in matlab than in c/c++. Your programs will run much more slowly and will not be able to take full advantage of your computer's resources, but these factors will not be too significant for the programs you need to write in 18.330. The main difficulty with matlab is that it is closed-source software that is almost prohibitively expensive for anybody outside an academic or corporate environment. (An individual copy costs around $3000, and even we MIT faculty and instructors have to pay $100 every year if we want to use it.) This means not only that (a) you may find yourself without access to the tool once you are out of college, but also (b) codes you may write and want to share with others may be of limited utility, because most people in the world don't have matlab.
This brings us to julia, which combines many of the best features of the previous two options. julia is an exciting new language developed over the past several years at MIT. It is as easy to use as matlab (which means it is much easier to get started with numerical programming in julia than in c/c++), but it has the critical advantage of being free, open-source software, so there is no fear of ever losing access to it, nor of wanting to share your codes with someone who doesn't have it herself. It is significantly faster than matlab (again, this is not a crucial concern for 18.330) and has an enthusiastic and rapidly growing base of users and contributors. This means, in particular, that (a) if you request a new feature you have a decent chance of getting somebody to implement it for you, and (b) there are lots of opportunities for you to contribute to this cool new project. (For example, implementing some pieces of numerical software for inclusion in the julia distribution would be a great final project for 18.330.) The main difficulty with julia is that it is quite new and hence a little rough around the edges. Certain things that you would expect to just work in more mature packages may turn out to be incompletely implemented or (alas) buggy in julia. The good news is that the aforementioned enthusiatic developer base is vigilant about addressing bug reports, so any issues that you encounter will probably get fixed quickly; however, using julia has a bit of a scrappy startup / wild-wild-west feel to it which may not appeal to all students.
See below for programming examples and tutorial walkthroughs to get you started with numerical programming in each of these three languages. We will also hold special office hours during the first week of class to make sure you are up and running with the programming language of your choice.
You may (and are encouraged to) work together on PSets, but you must write up and turn in your own solutions. For problems involving computer programs, you must submit a listing of your program and its output together with your PSet. If you work with other students to write your program, each student in your study group must separately type in and execute the program to generate a listing submitted with the PSet. This is to ensure that you become familiar with the mechanics and semantics (semicolons, parentheses, etc.) of programming.
|Last Updated||Topic||julia code|
|2/04/2014||Invitation to 18.330 and Numerical Analysis|
|2/06/2014||Convergence of Infinite Sums|
|2/06/2014||Numerical Integration, Part 1|
|2/13/2014||Ordinary differential equations||
|2/25/2014||Boundary value problems||
|3/11/2014||Quick note on convergence terminology|
|3/20/2014||Monte Carlo Integration|
|4/03/2014||Modulation: Wireless Communications and Lock-in Amplifiers|
|4/24/2014||The Discrete Fourier Transform|
|4/29/2014||Chebyshev Spectral Methods|
See the 18.330 PSet submission guidelines.
|Date Due||Problem Set||Solutions|
The final project for 18.330 is an exploration of a topic of your choice in numerical analysis. Typically this will be some numerical algorithm that we did not cover thoroughly in the course, although this is not the only possible choice.
You have considerable leeway in choosing a topic of interest to you and structuring your report in a way that is appropriate for the topic you choose, but your project must incorporate all of the following elements:
A rough guideline for the magnitude of the writeup is that it should consist of 15--20 LaTeX pages (including plots but not including code listings).
Before getting started on your final project, you must submit a brief proposal to let me know what you are planning to do and how you envision structuring your final report. This proposal is due by April 23, 2015 (you may email it to me directly or submit it in class). Below is a rough sample of what a reasonable proposal might look like.
Practical Evaluation of Lattice Sums: Is Ewald Summation Always Best?
Many problems in computational science require efficient and accurate evaluation of lattice sums---that is, sums that accumulate contributions to some physical quantity from sites in a one-, two-, or three-dimensional lattice. Brute-force evaluation of such sums is generally prohibitively expensive, and this fact has spurred the development of more sophisticated and efficient methods. In class we covered one such method---Ewald summation---but we discussed only the electrostatic (zero-frequency) case, and then only for the cases of one- and two-dimensional lattices. My final project will extend this discussion to a broader comparison of lattice-summation methods, including consideration of three-dimensional lattices and nonzero-frequency problems.
My paper will begin with a brief introduction (2--4 pages) to the problem. I will then discuss (3--5 pages) the history of lattice-summation methods, touching in particular on the original contributions of Paul Ewald himself and the physical problems that motivated his development of the Ewald-summation technique, but considering also the evolution of techniques spurred by the computer-aided-design (CAD) revolution of the late 20th century. Then I will explain (5-8 pages) the mathematical underpinnings of several sophisticated lattice-summation methods, including (1) Ewald summation, (2) Kummer decomposition, and (3) integral transforms. Finally, for the specific problem of a 2D lattice sum at nonzero frequency I will implement Ewald summation and Kummer decomposition and compare (3--5 pages) the accuracy and efficiency of these two methods.
Here are a couple of possible final-project topics. Needless to say, this is not intended to be an exhaustive list.
There is no assigned textbook for this course, but you may find the following references helpful. The links will direct you to online versions (in some cases you will need MIT certificates to access them).
|18.330 Spring 2015||Main course page|