These examples are based on the book
L. N. Trefethen, Spectral Methods in MATLAB, SIAM.
I have rewritten these codes in Python and added more examples.
I have some slides which I use for teaching along with this code, get them here.
You can get the codes and run them on your own computer
git clone https://github.com/cpraveen/chebpy
cd chebpy
jupyter-labFor nbviewer links to these files, see here
https://
Matlab versions of the code are available here
https://
Table of contents¶
- Spectral Methods
- p01: Convergence of fourth order finite differences
- p02: Convergence of periodic spectral method
- p03: Band-limited interpolation
- p04: Periodic spectral differentiation
- p05: Repetition of p04 via FFT
- p05b: Repetition of p05 via real FFT
- p05c: Repetition of p05 using scipy.fftpack.diff
- p06: Variable coefficient wave equation
- Variable coefficient acoustics equation
- p07: Accuracy of periodic spectral differentiation
- p08: Eigenvalues of harmonic oscillator
- p09: Polynomial interpolation in equispaced and chebyshev points
- p10: Polynomials and corresponding equipotential curves
- p11: Chebyshev differentiation of a smooth function
- p12: Accuracy of Chebyshev spectral differentiation
- p13: Solve linear BVP
- p14: Solve nonlinear BVP
- p15: Solve eigenvalue BVP
- p16: Poisson equation in 2-D
- p17: Helmholtz Equation in 2-D
- p18: Chebyshev differentiation via FFT
- p19: Second order Wave Equation on Chebyshev Grid
- p20: Second order wave equation in 2-D via FFT
- p21: Eigenvalues of Mathieu operator
- p22: 5’th eigenvector of Airy equation
- p23: Eigenvalues of Laplacian in 2-D
- p23a: Eigenvalues of perturbed Laplacian in 2-D
- p24: Pseudospectra of Davies’s complex harmonic oscillator
- p25: Stability regions for ODE formulas
- p26: Eigenvalues of 2nd order Chebyshev diff. matrix
- p27: Solve KdV equation
- Linear advection equation using FFT and RK4
- Burgers equation using FFT
- Eigenvalues of Chebyshev differentiation matrix
- p30: Spectral integration, ODE style
- p32: Solve linear BVP
- p33: Solve linear BVP, Neumann bc