https://github.com/yelyzavetav/trispectral
NumPy-based Python package for numerical differentiation using spectral methods
https://github.com/yelyzavetav/trispectral
numerical-differentiation numerical-integration spectral-methods
Last synced: 12 months ago
JSON representation
NumPy-based Python package for numerical differentiation using spectral methods
- Host: GitHub
- URL: https://github.com/yelyzavetav/trispectral
- Owner: YelyzavetaV
- License: mit
- Created: 2024-07-01T18:34:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-24T21:01:48.000Z (over 1 year ago)
- Last Synced: 2025-02-24T22:19:57.733Z (over 1 year ago)
- Topics: numerical-differentiation, numerical-integration, spectral-methods
- Language: Jupyter Notebook
- Homepage:
- Size: 1.78 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Trispectral
[](https://github.com/YelyzavetaV/trispectral/actions/workflows/tests.yml)
[](https://codecov.io/github/YelyzavetaV/trispectral)
Trispectral is a NumPy-based Python package for numerical differentiation using spectral collocation methods.
The user interface of Trispectral is compact and intuitive. For example, consider the function $f(x,y) = xe^{-(x^2 + y^2)}$ for $-1 \le x, y \le 1$. Using Trispectral we can compute the gradient of $f$ as follows:
```python
grid = Grid.from_bounds(
[-1., 1., 41], [-1., 1., 41], discs=["chebyshev"] * 2
)
x, y = grid
f = x * numpy.exp(-x**2 - y**2)
grad = gradient_operator(grid) @ f
```
Here, the object `grid` represents a $41\times 41$ Chebyshev-Chebyshev grid.
Combined with SciPy, Trispectral also provides tools for solving linear boundary-value problems and linear eigenvalue problems (including the problems of hydrodynamic linear stability). See the [Trispectral tutorials](https://github.com/YelyzavetaV/trispectral/tree/main/tutorials) for more information.
Trispectral currently supports
- 1D, 2D and 3D Cartesian geometries
- Polar geometry