Python Translations of the Trefethen Spectral Methods codes

These translations were made to facilitate the use of Lloyd N. Trefethen's book Spectral Methods in Matlab with free open-source software.
To run the codes, you need Python (2.X) and the packages NumPy, SciPy and Matplotlib.
If you find errors or have suggestions, please contact ringland at buffalo.edu.

Chapter 1. Differentiation Matrices

Program 1 , Output 1
Program 2 , Output 2

Chapter 2. Unbounded Grids: The Semidiscrete Fourier Transform

Program 3 , Output 3

Chapter 3. Periodic Grids: The DFT and FFT

Program 4 , Output 4
Program 5 , Output 5
Program 6 , Output 6 . waterfall.py needs polishing.
Program 6u , Output 6u

Chapter 4. Smoothness and Spectral Accuracy

Program 7 , Output 7
Program 8 , Output 8

Chapter 5. Polynomial Interpolation and Clustered Grids

Program 9 , Output 9
Program 10 , Output 10

Chapter 6. Chebyshev Differentiation Matrices

cheb , Output cheb
Program 11 , Output 11
Program 12 , Output 12

Chapter 7. Boundary Value Problems

Program 13 , Output 13
Program 14 , Output 14
Program 15 , Output 15
Program 16 , Output 16
Program 17 , Output 17

Chapter 8. Chebyshev Series and the FFT

chebfft , chebfft
Program 18 , Output 18
Program 19 , Output 19
Program 20 , Output 20
Program 20u , Output 20u

Chapter 9. Eigenvalues and Pseudospectra

Program 21 , Output 21
Program 22 , Output 22
Program 23a , Output 23a
Program 23 , Output 23
Program 24 , Output 24
Program 24fine , Output 24fine

Chapter 10. Time-Stepping and Stability Regions

Program 25 , Output 25
Program 26 , Output 26
Program 27 , Output 27

Chapter 11. Polar Coordinates

Program 28 , Output 28
Program 28b , Output 28b
Program 29 , Output 29

Chapter 12. Integrals and Quadrature Formulas

Program 30 , Output 30
clencurt , clencurt
Program 30b , Output 30b
gauss , gauss
Program 30c , Output 30c
Program 31 , Output 31

Chapter 13. More about Boundary Conditions

Program 32 , Output 32
Program 33 , Output 33
Program 34 , Output 34
Program 35 , Output 35
Program 36 , Output 36
Program 37 , Output 37

Chapter 14. Fourth-Order Problems

Program 38 , Output 38
Program 39 , Output 39
Program 40 , Output 40

leg , leg