Azzera filtri
Azzera filtri

Chebyshev Differentiation Matrix using two methods in MATLAB

33 visualizzazioni (ultimi 30 giorni)
I am trying to compare between two ''methods'' or functions that calculate the Chebyshev differentiation matrix. The first method uses the function cheb(N) from Trefethen's textbook and is defined as:
% CHEB compute D = differentiation matrix, x = Chebyshev grid
function [D,x] = cheb(N)
if N==0, D=0; x=1; return, end
x = cos (pi*(0:N)/N)';
c = [2; ones(N-1,1); 2].*(-1).^(0:N)';
X = repmat(x,1,N+1);
dX = X-X';
D = (c*(1./c)')./(dX+(eye(N+1))); % off-diagonal entries
D = D - diag(sum(D')); % diagonal entries
The above function utilizes the equation
for the off-diagonal entries but then obtains the diagonal entries using the identity:
which produces a Chebyshev matrix with better numerical stability properties.
Now, I have another method of calculating the Chebushev derivative using Vandermonde matrix as the following:
N = 10;
ygl = cos(pi*(0:N)/N)'; %Gauss-Lobatto chebyshev points
%Chebyshev matrix: Use the method: Vandermonde Matrices for Gauss-Lobatto
VGL = cos(acos(ygl(:))*(0:N));
dVGL = diag(1./sqrt(1-ygl.^2))*sin(acos(ygl)*(0:N))*diag(0:N);
dVGL(1,:) = (-1).^(1:N+1).*(0:N).^2;
dVGL(Ny+1,:) = (0:N).^2;
%Diferentiation matrix for Gauss-Lobatto points
Dgl = dVGL/VGL;
D = Dgl; %first-order derivative matrix
My question is what is the difference between the two methods above? and does the second method uses the identity:

Risposta accettata

Abhimenyu
Abhimenyu il 17 Giu 2024
Hello,
The Chebyshev differentiation matrix is a numerical tool used in spectral methods for solving differential equations. I understand that you are using two approaches for calculating the same matrix: Trefthen's Method and the Vandermonde Matrix Method.
  • Trefethen's Method: In this method, first the Chebyshev-Gauss-Lobatto points are calculated ('xi'). Then this method uses the explicit formula for the Chebyshev differentiation matrix with the off-diagonal and diagonal entries calculated separately. The diagonal entries are adjusted to ensure better numerical stability.
  • Vandermonde Matrix Method: In this method also, first the Chebyshev-Gauss-Lobatto points are calculated ('ygl'). Then this method constructs the differentiation matrix through the Vandermonde matrix and its derivative, followed by matrix inversion (caused by the division of 'dVGL/VGL' which is interpreted in MATLAB as 'dVGL⋅inv(VGL)' ). The stability depends on the numerical properties of the Vandermonde matrix and its inversion.
In the Vandermonde Matrix Method, the diagonal entries of 'Dgl' are inherently calculated through the matrix inversion process. Unlike Trefethen's method, it does not explicitly use the identity (mentioned in the query) instead, this identity is implicitly satisfied due to the nature of the matrix operations involved.
The matrix 'VGL'​ is constructed using the basis of Chebyshev polynomials, which form an orthogonal set. The differentiation matrix 'Dgl', resulting from 'dVGLinv(VGL)', maintains the property of polynomial differentiation at the grid points. One of the fundamental properties of differentiation matrices in the context of spectral methods is that the sum of each row (excluding the diagonal element) is equal to the negative of the diagonal element. This property is inherent to the structure of the differentiation matrix derived from polynomial interpolation at Chebyshev points. The differentiation matrix 'Dgl'​ is designed to approximate the derivative of a polynomial interpolant through the Chebyshev points. The matrix inversion process ensures that the resulting differentiation matrix captures the exact derivative relationships of these polynomials. Since the Chebyshev polynomials and their derivatives have specific symmetries and properties, the resulting matrix 'Dgl' naturally satisfies the row sum property for differentiation matrices.​
Both methods ultimately produce the Chebyshev differentiation matrix, but they use different mathematical and computational approaches.
I hope this helps!

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by