View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Fast Chebyshev second order differentiation

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 1.65 KB File ID: #44035 Version: 1.1

Fast Chebyshev second order differentiation


Matt (view profile)


21 Oct 2013 (Updated )

Fast computation of the second derivative of data located along Chebyshev points

| Watch this File

File Information

fchd2(V) computes the first derivative of the data in V located along the N+1 Chebyshev–Gauss–Lobatto points cos(pi*(0:N)/N).
  Example 1:
  Use fchd2 to find the second derivative of the function f(x) = tan(x)
  over [-1,1], and compare with f''(x) = 2 tan(x) sec(x)^2.
  x = cos(pi*(0:10)/10); % create sparse Chebyshev-spaced grid of 11 points
  xx = linspace(-1,1); % create dense, linearly spaced grid
  Example 2:
  To show the spectral convergence property of the Chebyshev derivative,
  compute the error between the Chebyshev second derivative and the exact
  second derivative of f(x) = tan(x) for several N.
  N = 1:30;
  err = zeros(1,length(N));
  for n = N
      x = cos(pi*(0:n)/n)'; % establish grid
      err(n) = max(2*tan(x).*sec(x).^2 - fchd2(tan(x))); % compute error
  loglog(N,err); %display

Required Products MATLAB
MATLAB release MATLAB 8.1 (R2013a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
22 Oct 2013 1.1

matched usual naming convention

Contact us