Exercises for lectures on Structure Preserving Methods on Staggered Grids (TUM, summer semester 2019).
For each exercise assignment, the solution will be provided in the form of an IPython notebook (a file with extension .ipynb) that mixes
The notebook is used for interactive data exploration, and it provides a high-level interface to dedicated Python3 modules and scripts (which take care of the real number crunching). In fact, it is also possible to run the scripts from a system terminal or an IPython console.
In order to effectively navigate through a solution notebook, it is strongly recommended to open it with JupyterLab. JupyterLab is included in the latest Python3 Anaconda distribution, or it may be installed using pip.
The JupyterLab distribution ships with a lot of built-in functionality, but we will use a few additional extensions to improve our workflow. The next section explains how to set up your environment.
Install JupyterLab if you do not have it
$ pip3 install jupyterlab
Install the ipympl
module
$ pip3 install ipympl
Install nodejs
and npm
libraries with one of the two following options
-
Download binary from https://nodejs.org/en/download/, or
-
Use your Linux package manager, e.g.
$ sudo apt install nodejs $ sudo apt install npm
Install the Matplotlib widget extension
$ jupyter labextension install @jupyter-widgets/jupyterlab-manager
$ jupyter labextension install jupyter-matplotlib
(Optional) Install the variable inspector extension
$ jupyter labextension install @lckr/jupyterlab_variableinspector
(Optional) Install the table of contents (TOC) extension
$ jupyter labextension install @jupyterlab/toc
(Optional) Install the IPython magics for generating figures with TikZ
$ sudo apt install imagemagick
$ sudo apt install pdf2svg
$ pip3 install git+git://github.com/mkrphys/ipython-tikzmagic.git