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).
A collection of example calculations and a gallery can be found here.
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.
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.
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.
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.
Before using the code, the tests should be run to make sure that they are working. From the top-level directory
$ pytest tests/
Psecas consist of three main classes
The Grid class
which contains the grid points and methods for performing spectral differentation on it.
The System class
which contains the linearized equations in string format, and other parameters of the problem. The parameters are allowed to depend on the coordinate.
The Solver class
which contains functionality for
Thomas Berlok
Gopakumar Mohandas (Implementation of the Legendre grid, VSI and Hall-MRI examples, advice and encouragement)