What’s New in MATLAB R2017b?

Following my earlier posts What’s New in MATLAB R2016b? and What’s New in MATLAB R2017a? I take a look here at the R2017b release of MATLAB. As before, this is not a comprehensive treatment (for which see the Release Notes), but rather a brief description of the changes in MATLAB (not the toolboxes) that are the most notable from my point of view.

Decomposition Object

MATLAB now has a way of avoiding unnecessarily repeating the factorization of a matrix. In the past, if we wanted to solve two linear systems Ax = b and Ay = c involving the same square, general nonsingular matrix A, writing

x = A\b;
y = A\c;

was wasteful because A would be LU factorized twice. The way to avoid this unnecessary work was to factorize A explicitly then re-use the factors:

[L,U] = lu(A);
x = U\(L\b);
y = U\(L\c);

This solution lacks elegance. It is also less than ideal from the point of view of code maintenance and re-use. If we want to adapt the same code to handle symmetric positive definite A we have to change all three lines, even though the mathematical concept is the same:

R = chol(A);
x = R\(R'\b);
y = R\(R'\c);

The new decomposition function creates an object that contains the factorization of interest and allows it to be re-used. We can now write

dA = decomposition(A);
x = dA\b;
y = dA\c;

MATLAB automatically chooses the factorization based on the properties of A (as the backslash operator has always done). So for a general square matrix it LU factorizes A, while for a symmetric positive definite matrix it takes the Cholesky factorization. The decomposition object knows to use the factors within it when it encounters a backslash. So this example is functionally equivalent to the first two.

The type of decomposition can be specified as a second input argument, for example:

dA = decomposition(A,'lu');
dA = decomposition(A,'chol');
dA = decomposition(A,'ldl');
dA = decomposition(A,'qr');

These usages make the intention explicit and save a little computation, as MATLAB does not have to determine the matrix type. Currently, 'svd' is not supported as a second input augment.

This is a very welcome addition to the matrix factorization capabilities in MATLAB. Tim Davis proposed this idea in his 2013 article Algorithm 930: FACTORIZE: An Object-Oriented Linear System Solver for MATLAB. In Tim’s approach, all relevant functions such as orth, rank, condest are overloaded to use a decomposition object of the appropriate type. MATLAB currently uses the decomposition object only in backslash, forward slash, negation, and conjugate transpose.

The notation dA used in the MathWorks documentation for the factorization object associated with A grates a little with me, since dA (or \Delta A) is standard notation for a perturbation of the matrix A and of course the derivative of a function. In my usage I will probably write something more descriptive, such as decompA or factorsA.

String Conversions

Functions written for versions of MATLAB prior to 2016b might assume that certain inputs are character vectors (the old way of storing strings) and might not work with the new string arrays introduced in MATLAB R2016b. The function convertStringsToChars can be used at the start of a function to convert strings to character vectors or cell arrays of character vectors:

function y = myfun(x,y,z)
[x,y,z] = convertStringToChars(x,y,z);

The pre-2016b function should then work as expected.

More functions now accept string arguments. For example, we can now write (with double quotes as opposed to the older single quote syntax for character vectors)

>> A = gallery("moler",3)
A =
     1    -1    -1
    -1     2     0
    -1     0     3

Tall Arrays

There is more support in R2017b for tall arrays (arrays that are too large to fit in memory). They can be indexed, with sorted indices in the first dimension; functions including median, plot, and polyfit now accept tall array arguments; and the random number generator used in tall array calculations can be independently controlled.

Word Clouds

The new wordcloud function produces word clouds. The following code runs the function on a file of words from The Princeton Companion to Applied Mathematics.

words = fileread('pcam_words.txt');
words = string(words);
words = splitlines(words);
words(strlength(words)<5) = [];
words = categorical(words);
figure
wordcloud(words)

I had prepared this file in order to generate a word cloud using the Wordle website. Here is the MATLAB version followed by the Wordle version: wordcloud_pcam.jpg wordle-edited2.jpg Wordle removes certain stop words (common but unimportant words) that wordcloud leaves in. Also, whereas Wordle produces a different layout each time it is called, different layouts can be obtained from wordcloud with the syntax wordcloud(words,'LayoutNum',n) with n a nonnegative integer.

Minima and Maxima of Discrete Data

New functions islocalmin and islocalmax find local minima and maxima within discrete data. Obviously targeted at data manipulation applications, such as analysis of time series, these functions offer a number of options to define what is meant by a minimum or maximum.

The code

A = randn(10); plot(A,'LineWidth',1.5); hold on
plot(islocalmax(A).*A,'r.','MarkerSize',25); 
hold off, axis tight

finds maxima down the columns of a random matrix and produces this plot: islocalmax_plot.jpg

Whereas min and max find the smallest and largest elements of an array, the new functions mink(A,k) and maxk(A,k) find the k smallest and largest elements of A, columnwise if A is a matrix.

Foundations of Applied Mathematics Book Series

171014-1019-53_8051.jpg

Foundations of Applied Mathematics, Volume 1: Mathematical Analysis was published by SIAM this summer. Written by Jeffrey Humpherys, Tyler J. Jarvis, and Emily J. Evans, all from Brigham Young University, this is the first of a four-book series, aimed at the upper undergraduate or first year graduate level. It lays the analysis and linear algebra foundations that the authors feel are needed for modern applied mathematics.

The next book, Volume 2: Algorithms, Approximation, and Optimization, is scheduled for publication in 2018.

At 689 pages, hardback, beautifully typeset on high quality paper, and with four colours used for the diagrams and boxed text, this is a physically impressive book. Unusually for a SIAM book, it contains a dust jacket. I got a surprise when I took it off: underneath is a front cover very different to the dust jacket, containing a huge number 1. I like it and am leaving my book cover-free.

I always look to see what style decisions authors have made, as I ponder them a lot when writing my own books. One was immediately obvious: the preface uses five Oxford commas in the first six sentences!

I have only had time to dip into a few parts of the book, so this is not a review. But here are some interesting features.

  • Chapter 15, Rings and Polynomials, covers a lot of ground under this general framework, including the Euclidean algorithm, the Lagrange and Newton forms of the polynomial interpolant, the Chinese remainder theorem (of which several applications are mentioned), and partial fractions. This chapter has attracted a lot of interest on Reddit.
  • The authors say in the preface that one of their biggest innovations is treating spectral theory using the Dunford-Schwartz approach via resolvents.
  • There is a wealth of support material available here. More material is available here.

It’s great to see such an ambitious project, especially with SIAM as the publisher. If you are teaching applied mathematics with a computational flavour you should check it out.

Christopher T. H. Baker (1939–2017)

By Nick Higham and Neville Ford (University of Chester)

970623_1_cthb_cropped.jpg
Christopher Baker at the eighth Leslie Fox Prize Meeting, Dundee University, June 23, 1997.

Christopher Thomas Hale Baker died on August 20, 2017 at the age of 78. He was born on the Isle of Thanet, Kent, in 1939, and was educated at Colchester Royal Grammar School and Jesus College Oxford, where he held an Edwin Jones Scholarship and a State Scholarship.

His first full-time employment was between school and college, when he worked in the Physics Research Laboratory of BX Plastics. He obtained his BA in 1961 and his M.A. and D.Phil., in 1964, from the University of Oxford. Between 1964 and 1966 he held a Fulbright Award and was Instructor and PG Research Mathematician at UC Berkeley. From 1966 Christopher was lecturer, senior lecturer and then reader at the University of Manchester, becoming professor in 1989. He had periods of leave at the University of Toronto (in 1972 and 1976) and Oxford University.

Christopher served as head of the numerical analysis group for around ten years and served as Head of Department for three years from September 1995. Following his retirement in 2004, Christopher joined the University of Chester as a part-time member of the department, retiring from that role in 2016. At the time of his death he held the title of Emeritus Professor at both the University of Manchester and the University of Chester.

Christopher was founding Director of the Manchester Centre for Computational Mathematics (MCCM), formed in 1992 by the numerical analysis groups at the University of Manchester and UMIST to build on existing collaborations. In his ten years as Director, the centre grew substantially in activity, as seen particularly in the Numerical Analysis Report series, and the M.Sc. in Numerical Analysis and Computing. Christopher was instrumental in involving external researchers in MCCM, notably the Chester numerical analysts.

His research interests included numerical solution of integral equations and functional differential equations (integro-differential and delay-differential equations), and parameter estimation in models. He is perhaps best-known for his monumental 1034-page monograph Numerical Treatment of Integral Equations (Clarendon Press, Oxford, 1977). He was able to expand some of the tools and techniques developed for integral equations into newly emerging fields of numerical dynamics and numerical methods for stochastic differential equations.

Christopher organized two Durham Symposia. The first, “Numerical Treatment of Integral Equations” (1982), was attended by 67 mathematicians from around the world. The second, “Evolutionary Problems: Continuous and Discretized Nonlinear Systems” (July 4-14, 1992), organized jointly with Ruth Thomas, had 92 attendees.

In his introduction to the 2000 annual report of MCCM, Christopher offered some thoughts on the nature of Numerical Analysis.

“To some, the emphasis should be on computational mathematics, to others the emphasis should be on a unifying perspective from the viewpoint of applied analysis. To the writer, numerical analysis is ideally a broad church and like other sections of applied mathematics should be informed by modelling considerations, investigations based on simulation or analysis, and the practicalities of modern computing. As an integrated part of applied mathematics, the skills developed in numerical analysis complement and are complemented by perspectives obtained from other areas; numerical analysis should be supported by insights from modelling, and from the more abstract areas of mathematics, and computer science.”

Those words strike us as just as valid today as when Christopher wrote them seventeen years ago.

Christopher was a member of the 1992 Mathematics Assessment Panel in the UFC Research Assessment Exercise and of the Applied Mathematics panel in the 1996 Research Assessment Exercise. He chaired the Applied Mathematics panel in the 2001 Research Assessment Exercise. Serving on three successive panels was a major service to the mathematics community. Some idea of this is given by Christopher’s comment in the 2002 MCCM annual report, “During most of 2001, every flat surface at home and in my office was covered with RAE paperwork”.

He was a Fellow of the Institute of Mathematics and its Applications and served as editor of the IMA Journal of Numerical Analysis from its foundation in 1981 to 1996. He was a dedicated editor, also giving long service to other journals including Journal of Computational and Applied Mathematics, Journal of Integral Equations and Applications, and Advances in Computational Mathematics.

Here is a list of his PhD students (complete as far as we know), with their last known affiliations.

  • Ian Gladwell (Southern Methodist University, Dallas)
  • Malcolm Keech (University of Bedfordshire)
  • Siamak Amini (University of Salford)
  • Athena Makroglou (University of Portsmouth)
  • Mishi Derakshan (Dassault Systems BIOVIA)
  • Neville Ford (University of Chester)
  • Christopher Paul (University of Manchester)
  • David Willé (Heidelberg, Germany)
  • Arsalang Tang (Concordia University, Montreal, Canada)
  • Fathalla A. Rihan (United Arab Emirates University)
  • Ali Filiz (Adnan Menderes University, Turkey)
  • Hongjiong Tian (Shanghai Normal University, China)
  • Yihong Song (Suzhou University, Jiangsu, China)
  • Ephraim O. Agyingi (Rochester Institute of Technology, NY)
  • Eugene Parmuzin (INMRAS, Moscow, Russia)

Christopher had heart bypass surgery in 1988 and the surgeon told him “We know these vein grafts last for 12 years”. Thankfully, that was a severe underestimate, and Christopher maintained all his usual activities right until the end.

Christopher will be remembered as a kind, generous, and sociable colleague as well as for his leadership in applied mathematics and numerical analysis in Manchester, Chester, across the UK, and beyond.

Christopher is survived by his wife Helen, his children Deborah and Mark, and four grandchildren

Nick writes:

Christopher was a student at Oxford when Leslie Fox was Professor of Numerical Analysis and head of the Computing Laboratory. According to David Sayers, Fox used to refer to Christopher as “that pure mathematician”—presumably because of the rigorous mathematical approach that Christopher used in his research on the numerical treatment of integral equations. When I was a PhD student I remember hearing of a seminar where the speaker showed how to solve numerically an integral equation for which there was later shown to be no solution. Christopher would never fall into such a trap! He served for three years on the adjudicating committee for the Leslie Fox prize, chairing it in 1997. He dedicated a paper (“Parallel continuous Runge-Kutta methods and vanishing lag delay differential equations”, 1993) to the memory of Leslie Fox.

Christopher was a shrewd operator at faculty level. He secured many promotions in the department at a time when they were limited by university finances. He was responsible for mathematics being chosen as the location for a large PC cluster in the early days of the use of PCs for teaching. I found a 1993 email in which Christopher wrote, to colleagues in the department, many of whom were not au fait with computing:

“You may ask why it is thought that computers can assist teaching … Computers can be used to yield visual and numerical insight, if the right packages are used. They can also access databases (library catalogues, journal and book reviews, etc.) The international trends are quite clear. It is also quite clear that computers are a genuine aid to modern mathematical research and development; some of our graduates will become real mathematicians.”

Christopher was an enthusiastic early adopter of email, originally on the university CMS system. He was professor in charge of computing for many years in the 1990s: a major task in a time of rapid change.

Neville writes:

Christopher’s involvement with colleagues at the University of Chester stems from his collaboration with me that has lasted more than 30 years. My former pure mathematics tutor, Brian Steer (who had been a student with Christopher during his time at Jesus College) put me in touch with Christopher as somebody who could supervise me (interests in functional and classical analysis) and help me establish myself in numerical analysis. As Nick describes, Christopher was always shrewd. I recognise the way careful supervision encouraged students to play to their strengths and to answer research questions which other people would find to be interesting. He frequently reminded us all that no question is worth answering unless somebody other than the author of the paper is asking it. I also remember being challenged repeatedly by his question ‘what do you mean by …’ (stability, for example) reflecting his determination to understand the underlying mathematics before venturing an opinion on a numerical scheme.

Christopher was responsible for inviting members of the Chester mathematics team to join with the Manchester Centre for Computational Mathematics, a co-operation which worked very effectively for our emerging research group, and on his retirement from Manchester we were pleased to welcome him as a member of our team, so collaborations between Christopher and the Chester group continued to develop. Even though some new members of our group had known him only for a short time before his death, they describe how much he continued to help by challenging their thinking, suggesting interesting fresh insights and contributing to the seminar programme.

Updated October 4, 2017 to correct the list of PhD students.