You are here

Riemann Problems and Jupyter Solutions

David I. Ketcheson, Randall J. LeVeque, and Mauricio J. del Razo
Publication Date: 
Number of Pages: 
Fundamentals of Algorithms
[Reviewed by
Jason M. Graham
, on
Riemann problems are concerned with a set of relatively simple initial value problems (IVPs) for a certain class of partial differential equations (PDEs), that is, first-order hyperbolic conservation laws. The study of Riemann problems plays an important role in the mathematical and numerical analysis of hyperbolic conservation laws, as well as in understanding physical phenomena such as wave propagation and gas dynamics.
For those that are not already familiar with the notion of the Riemann problem, we briefly describe the underlying idea. An initial value problem for an ordinary differential equation (ODE) specifies the value of a solution to the equation at one single time-point by prescribing the solution to equal some constant value at a particular time. Initial value problems for PDEs are more complicated because they may specify the spatial distribution of a solution to the equation at a particular time. Thus, an initial value problem for a PDE might involve an initial function instead of an initial constant. Riemann problems involve an initial function that is piecewise constant (in the spatial variable). Piecewise constant functions may have a (jump) discontinuity, and you might wonder how does it make sense for a solution to a differential equation to have a discontinuity. This is addressed by way of the notion of weak solutions, a topic, among many others, that is covered in the book Riemann Problems and Jupyter Solutions.
In fact, Riemann Problems and Jupyter Solutions covers many of the most well-established concepts and techniques for studying and solving first-order hyperbolic conservation laws as well as many of their classical applications.  In addition to introducing first-order hyperbolic conservation laws (linear and nonlinear) and the Riemann problem, the book covers in an introductory manner characteristics, shock formation, entropy and Rankine-Hugoniot conditions; applications such as Burger's equation, traffic-flow models, shallow water equations, and Euler equations; and numerical approximation methods with an eye toward finite volume methods. Given that, as the authors note, these topics are all well-covered elsewhere one might ask what is new in Riemann Problems and Jupyter Solutions? That is where the second half of the book title becomes highly relevant.
The well-known Jupyter notebooks provide a platform for interactive computing with Python (\url{}) as well as many other programming languages. Within a Jupyter notebook which is run via a web browser, one may integrate code, text, mathematical notation, figures, output from code, etc. Indeed, the entirety of Riemann Problems and Jupyter Solutions was produced by compiling a series of Jupyter notebooks into what ultimately became the printed text. This means that 1) the book is completely reproducible, and 2) the book is interactive in the sense that the reader can run Python code to produce and interact with plots and visualizations illustrating the behavior of solutions to Riemann problems. In fact, the authors have made the set of Jupyter notebooks used to produce Riemann Problems and Jupyter Solutions freely available and all of the code necessary to build the notebooks and compile the text can be obtained from a GitHub repository.  As a helpful hint, if you clone this repository and install the software it is probably best to do this in a virtual environment to avoid conflicts with existing packages and Python versions.
In reviewing Riemann Problems and Jupyter Solutions, I wanted to try all aspects of this book out for myself. Thus, I cloned the GitHub repository for the book and ran all of the code/notebooks in order to test out the interactive features of the book. I had no difficulties installing and running the necessary software by following the instructions on the GitHub repository for the book code. One thing to note is that the interactive book uses the Clawpack library which implements numerical algorithms for approximating solutions to Riemann problems. Installing Clawpack as described on the GitHub repository requires a Fortran compiler. However, the official Clawpack documentation states that the library may also be installed via the Conda package manager without the requirement of a Fortran compiler although I did not try this approach as the installation method described on the repo worked well for me.
In testing out the interactive version of the book, everything worked beautifully. I was able to reproduce all of the wonderful figures and the interactive animations all worked very well. There is a lot to be gained by reading this book via the interactive format since this allows one to see the dynamic behavior of solutions to Riemann problems directly for themselves. In addition to developing an understanding of the theory, solutions techniques, and applications associated with Riemann problems one also walks away with a set of computational tools and an appreciation for numerical methods after reading Riemann Problems and Jupyter Solutions.
In summary, Riemann Problems and Jupyter Solutions covers the mathematical and numerical analysis and applications of Riemann problems for first order (linear and nonlinear) hyperbolic conservation laws at a level appropriate for students beginning to study partial differential equations. Although, the lack of exercises may limit the use of Riemann Problems and Jupyter Solutions as a stand-alone textbook for a course, it covers material very well and provides an interactive platform that is very helpful in gaining intuition and insight into the essential behaviors of solutions to hyperbolic conservation laws.  Furthermore,  provides strong evidence that there is great value in exploiting the capabilities provided by Jupyter notebooks to develop an interactive text for suitable topics in applied mathematics and scientific computing.
Jason Graham is an Associate Professor in the Department of Mathematics at the University of Scranton.  He received his PhD from the program in Applied Mathematical and Computational Sciences at the University of Iowa. His professional interests are in applied mathematics and mathematical biology.