Trefethen & Bau, via MATLAB and Julia

math
computing
teaching
Author

Toby Driscoll

Published

September 1, 2016

This semester I’m teaching MATH 612, which is numerical linear and nonlinear algebra for grad students. Linear algebra dominates the course, and for that I’m following the now classic textbook by Trefethen & Bau. This book has real meaning to me because I learned the subject from Nick Trefethen at Cornell, just a year or two before the book was written. It’s when numerical analysis became an appealing subject to me.

That course is also when I started to learn MATLAB. I’ve been using MATLAB for over 20 years and I’m damn good at it. I’ve written a book that teaches it, and another book largely based on asoftware package I wrote for conformal mapping, and I was an early and key contributor to the Chebfun project. I even dominated a game of MATLAB Jeopardy as a grad student at the 1995 MATLAB Conference (when version 4.2 of MATLAB ruled the Earth).

(It isn’t quite contemporary, but the 1996 home page for the Cornell Center for Applied Mathematics has a banner graphic created in MATLAB—by yours truly.)

The tl;dr is that MATLAB has dominated my professional life since that course. It’s still a great tool to use for that course, too—in my mind, learning the theory and learning the numerics are inextricable. In the context of computing, it’s incredible to have a 25-year winning streak!

But while the pedagogical value remains as high as ever, MATLAB is a smaller part of the “desktop scientific computing” landscape than it was. It’s still a behemoth, but there are more good options than ever.  For some time I have felt neglectful toward options that are similar but different, namely SciPy and Julia. I’ve picked up bits and pieces of them, but not enough to do any serious work.

Thus I’ve decided to learn Julia the same way I did MATLAB: by using it as we cover elementary numerical linear algebra. The students will still get MATLAB, but I’ll be doing Julia in parallel. For each lecture (chapter) of Trefethen & Bau, I’ll make two Jupyter notebooks with identical text and two versions of the codes. I’m not rewriting T&B, just trying to illustrate some of the concrete ideas and conclusions in each lecture. I’m sure my early Julia efforts will be cringeworthy to the cognoscenti, but just as with learning a human language, you have to risk sounding stupid for a while in order to start sounding less stupid. If I can keep up the pace, I’ll blog about what I learn about porting to Julia with each new notebook.