Skip to content

Spectral differentiation and interpolation methods in Julia

License

Notifications You must be signed in to change notification settings

l90lpa/DMSuite.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DMSuite.jl

Spectral differentiation and interpolation methods under various bases (Chebyshev, Hermite, Laguerre, Legendre, Fourier, Sinc) in Julia. This suite of functionality was originally proposed and implemented in Matlab by, J. A. Weideman and S. C. Reddy [1].

Theory of Spectral Methods

For information on spectral methods one could consult, Spectral Methods in Matlab (by L.N. Trefethen) for a more practical introduction, and/or Spectral Methods: Fundamentals in Single Domains (by C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang) for a more theoretical treatment.

Usage

DMSuite does not depend on a specific FFT implementation, instead it is built against the abstract interface AbstractFFTs.jl. Therefore to use a method such as chebdifft, one must install and load an FFT implementation such as FFTW.jl or FastTransforms.jl.

Example

Solve the BVP: $u'' = \exp(4x)$, subject to the BCs, $u(-1)=u(1)=0$

using FastTransforms
using DMSuite
using Plots

N = 16
M = 2
x,DM = chebdif(N+1,M)
D2 = DM[2:N,2:N,2]       # impose boundary conditions
f = exp.(4 .* x[2:N])    # impose boundary conditions

u = D2 \ f     # solve
u = [0;u;0]    # set boundary values

xx = -1:0.01:1
uu = chebint(u,xx)
plot(xx,uu)

Alternative Libraries

An alternative to DMSuite, at a higher level of abstraction and with a wider feature set, is ApproxFun.jl

References

  1. J. A. Weideman and S. C. Reddy. 2000. A MATLAB differentiation matrix suite. ACM Trans. Math. Softw. 26, 4 (Dec. 2000), 465–519. https://doi.org/10.1145/365723.365727
  2. W. S. Don and A. Solomonoff. 1995. Accuracy and Speed in Computing the Chebyshev Collocation Derivative. SIAM J. Sci. Comput. 16, 6 (Nov. 1995), 1253–1268. https://doi.org/10.1137/0916073
  3. R. Baltensperger and M. R. Trummer. 2003. Spectral Differencing with a Twist. SIAM J. Sci. Comput. 24, 5 (Jan. 2003), 1465–1487. https://doi.org/10.1137/S1064827501388182
  4. P. Henrici. Essentials of Numerical Analysis. 1982. Wiley. (barycentric formula see page 252)
  5. P. Henrici. Applied & Computational Complex Analysis III. 1986. Wiley. (barycentric formula see page 46)

About

Spectral differentiation and interpolation methods in Julia

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages