Manual
Manual
August, 2011
2
A. Introduction
This note is devoted to some instructions to the Matlab routines for the funda-
mental spectral algorithms presented in the book:
Jie Shen, Tao Tang and Li-Lian Wang. Spectral Methods: Algorithms, Anal-
ysis and Applications. Springer Series in Computational Mathematics, 41,
Springer, 2011.
This package consists of a collection of Matlab functions which are indispens-
able for spectral-Galerkin/collocation approximations of partial differential equations.
These include routines for
• Evaluation of Legendre polynomials, Jacobi polynomials, (generalized) La-
guerre polynomials/functions and Hermite polynomials/functions.
• Computation of the Gaussian-type quadrature nodes and weights associated
with these orthogonal polynomials/functions.
• Differentiation in the physical space via differentiation matrix.
• Implementation of pseudospectral techniques: discrete transforms and dif-
ferentiation in frequency spaces.
• Applications of these basic algorithms for solving PDEs.
We attempt to provide one-to-one correspondence between the codes and the
equations, formulas and algorithms in the book, and have made significant efforts to
test these functions. However, the users are advised to choose the underlying degree
of modes and parameters from the range of standard setting. You are more than
welcome to email us if you find bugs or have comments.
We also refer to the readers to the following online software in Fortran or Matlab
on spectral methods:
• Fortran Routines for Spectral Methods by D. Funaro, which are avail-
able at http://cdm.unimo.it/home/matematica/funaro.daniele/rout.htm
• A Matlab Differentiation Matrix Suite by J. Weideman and S. Reddy,
which is downloadable at http://dip.sun.ac.za/ weideman/research/differ.html
• PseudoPack by W.S. Don and B. Costa, which can be found at
http://www.math.hkbu.edu.hk/∼ wsdon/
• Some codes for Spectral Methods in Matlab by L. Trefethen, which can
be downloaded from http://people.maths.ox.ac.uk/trefethen/spectral.html
3
B. Instructions
[1] J. Shen, T. Tang and L.L. Wang. Spectral Methods: Algorithms, Analysis and Applications.
Springer Series in Computational Mathematics, Volumn 41, Springer, 2011.
[2] L. Trefethen. Spectral Methods in Matlab, Volumn 10, SIAM, 2000.
[3] E. Yakimiw. Accurate computation of weights in classical Gauss-Christoffel quadrature
rules,Journal of Computational Physics, 129(2), 406-430, 1996.