tberlok / psecas

A framework for solving numerical eigenvalue problems using pseudo-spectral methods.
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

CircleCI Build Status codecov

Psecas

Psecas (Pseudo-Spectral Eigenvalue Calculator with an Automated Solver) is a collection of methods for solving eigenvalue problems (EVPs) using pseudo-spectral methods. Psecas was developed for solving the kind of eigenvalue problem that often arises when a linear stability calculation is performed in astrophysical fluid dynamics. The code was introduced in a MNRAS paper where details on how it all works can be found (arxiv version can be downloaded here).

Gallery and examples

A collection of example calculations and a gallery can be found here.

Publications

So far Psecas has been used in the following publications

If you are here for the Kelvin-Helmholtz instability verification tests presented in Table 2 in the first paper, then you can find more information here.

How it works

Pseudo-spectral methods are described in e.g. the books Spectral Methods in Matlab by Lloyd N. Trefethen, A Practical Guide to Pseudospectral Methods by Bengt Fornberg and Chebyshev and Fourier Spectral Methods by John P. Boyd.

In Psecas, the user writes down a linearized set of equations, the eigenvalue problem, which is automatically discretized on either an infinite, finite or periodic domain. The resulting EVP can then be solved to a requested precision.

Grids

An overview of various grid types is shown on page 11 in the book by Boyd.

The code currently has all the grids mentioned on this figure, they are illustrated with 9 grid points below:

We use (a fork) of a Python version of

J. A. C. Weidemann and S. C. Reddy, A MATLAB Differentiation Matrix Suite, ACM Transactions on Mathematical Software, 26, (2000): 465-519.

for creating the Laguerre and Hermite grids. The other grids are created using the descriptions in the books by Boyd and Trefethen.

Installation

I assume you have Python 3.6 installed. If so, all requirements are simply installed by running the following command

$ pip install -r requirements.txt

at the top-level directory.

Testing

Before using the code, the tests should be run to make sure that they are working. From the top-level directory

$ pytest tests/

Overview of the code

Psecas consist of three main classes

Developers

Main developer

Thomas Berlok

Contributors

Gopakumar Mohandas (Implementation of the Legendre grid, VSI and Hall-MRI examples, advice and encouragement)