I have re-written the codes given in Trefethen's Spectral Methods in Matlab using python. You can find them in the following links as ipython notebooks.

If you have any suggestions to improve them or find a mistake, then I would like to hear.

A similar project is another-chebpy. Some of the following code is borrowed from another-chebpy. To get all the files, do

`$ git clone https://github.com/cpraveen/chebpy`

You can also read the code on github.

- Convergence of fourth order finite differences
- Convergence of periodic spectral method
- Band-limited interpolation
- Periodic spectral differentiation
- Repetition of Program 4 via FFT
- Variable coefficient wave equation
- Accuracy of periodic spectral differentiation
- Eigenvalues of harmonic oscillator
- Polynomial interpolation in equispaced and chebyshev points
- Polynomials and corresponding equipotential curves
- Chebyshev differentiation of a smooth function
- Accuracy of Chebyshev spectral differentiation
- Solve linear BVP
- Solve nonlinear BVP
- Solve eigenvalue BVP
- Poisson equation on [-1,1]x[-1,1] with u=0 on boundary
- Helmholtz equation
- Chebyshev differentiation via FFT
- Second order Wave Equation on Chebyshev Grid
- Second order Wave Equation using FFT
- Eigenvalues of Mathieu operator
- 5'th eigenvector of Airy equation
- Eigenvalues of perturbed Laplacian
- Pseudospectra of Davies complex harmonic oscillator
- Stability regions for ODE formulas
- Eigenvalues of 2nd-order Chebyshev diff. matrix
- Solve KdV equation