Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrenarchy/pseudopy
PseudoPy computes and visualizes the pseudospectrum of a matrix
https://github.com/andrenarchy/pseudopy
Last synced: 2 months ago
JSON representation
PseudoPy computes and visualizes the pseudospectrum of a matrix
- Host: GitHub
- URL: https://github.com/andrenarchy/pseudopy
- Owner: andrenarchy
- License: mit
- Created: 2014-01-31T15:54:17.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T10:16:57.000Z (about 6 years ago)
- Last Synced: 2024-08-08T22:37:38.438Z (6 months ago)
- Language: Python
- Size: 122 KB
- Stars: 24
- Watchers: 6
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PseudoPy [![Build Status](https://travis-ci.org/andrenarchy/pseudopy.png?branch=master)](https://travis-ci.org/andrenarchy/pseudopy)
PseudoPy computes and visualizes the pseudospectrum of a matrix. It is a Python version of the original [eigtool](http://www.cs.ox.ac.uk/pseudospectra/eigtool/) by Thomas G. Wright. The algorithms used in this package can be found in the book [Spectra and pseudospectra](http://press.princeton.edu/titles/8113.html) by [Nick Trefethen](http://www.maths.ox.ac.uk/people/profiles/nick.trefethen) and [Mark Embree](http://www.caam.rice.edu/~embree/).
## Example
The pseudospectrum of the Grcar matrix looks like this:![Pseudospectrum of Grcar matrix](grcar.png)
If no knowledge about the location of the pseudospectrum of the given matrix is available, the following lines of code can be used to obtain an approximation:
```python
from pseudopy import NonnormalAuto, demo
from matplotlib import pyplot
from scipy.linalg import eigvals# get Grcar matrix
A = demo.grcar(32).todense()# compute pseudospectrum for the levels of interest between [1e-5, 1]
pseudo = NonnormalAuto(A, 1e-5, 1)# plot
pseudo.plot([10**k for k in range(-4, 0)], spectrum=eigvals(A))
pyplot.show()
```## Installation
### Dependencies
PseudoPy depends on numpy, scipy, matplotlib and shapely. If you are on Debian/Ubuntu, you can install these dependencies with
```
sudo apt-get install python-numpy python-scipy python-matplotlib python-shapely
```### pip
```pip install pseudopy```Note that you may need to add `sudo` if you want to install it system-wide.
## License
PseudoPy is free software licensed under the [MIT License](http://opensource.org/licenses/mit-license.php).