On the accuracy of pseudospectral differentiation

Abstract

For various grids on a finite interval we measure the accurarcy of pseudospectral (collocation) differentiation matrices using two parameters. The first one is the rank defficiency of the differentation matrices. The second one quantifies the extent at which such matrices transform a constant vector into the null vector.

Authors

C.I. Gheorghiu
Tiberiu Popoviciu Institute of Numerical Analysis

Keywords

pseudospectral differentiation; Chebyshev-Gauss-Lobatto grid; Legendre grid; equidistant grid; accuracy; floating-point arithmetic

References

See the expanding block below.

Paper coordinates

C.I. Gheorghiu,  On the accuracy of pseudospectral differentiation, ROMAI J., 10 (2014) no. 1, pp. 55-62.

PDF

About this paper

Journal

ROMAI J.

Publisher Name
Paper on journal website
Print ISSN

2065-7714

Online ISSN

1841-5512

MR

?

ZBL

?

Google Scholar

?

[1] Atkinson, K., Han, W., Theoretical Numerical analysis. A Functional Analysis Framework,  Third Ed., Springer 2009.

[2] Canuto, C., Hussaini, M. Y., Quarteroni, A., Zang, T.A.,  Spectral Methods in Fluid Dynamics,  Springer Verlag, Berlin, 1988.

[3] Gheorghiu, C.I.,  Spectral Methods for Differential Problems,  Casa Cartii de Stiinta Publishing House, Cluj-Napoca, 2007.

[4] Gheorghiu, C. I., Spectral  Methods for Non-Standard Eigenvalue Problems. Fluid and Structural Mechanics and Beyond,  Springer Briefs in Mathematics, 2014.

[5] Gottlieb, D., Orszag, S.A.,  Numerical Analysis of Spectral Methods: Theory and Applications, I SIAM Philadelphia, 1977.

[6] Henrici, P., Applied and Computational Complex Analysis: Discrete Fourier Analysis-Cauchy Integrals-Construction of
Conformal Maps-Univalent Functions, Vol. 3 John Wiley and Sons, Inc., New York, 1986.

[7] Weideman, J.A.C., Reddy, S.C. A MATLAB Differentiation Matrix Suite, ACM Trans, on Math. Software, 26, 465-519 (2000)

?

Paper (preprint) in HTML form

ON THE ACCURACY OF PSEUDOSPECTRAL DIFFERENTIATION
Călin Ioan Gheorghiu
"T. Popoviciu" Institute of Numerical Analysis, Romanian Academy, Cluj-Napoca, Romania
ghcalin@ictp.acad.ro

Abstract

For various grids on a finite interval we measure the accuracy of pseudospectral (collocation) differentiation matrices using two parameters. The first one is the the rank defficiency of the differentiation matrices. The second one quantifies the extent at which such matrices transform a constant vector into the null vector.

See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/270816787

On the accuracy of pseudospectral differentiation.

Keywords: pseudospectral differentiation; Chebyshev-Gauss-Lobatto grid; Legendre grid; equidistant grid; accuracy; floating-point arithmetic.
𝟐𝟎𝟏𝟎𝐌𝐒𝐂:𝟔𝟓𝐃𝟐𝟓(𝐏𝐫𝐢𝐦𝐚𝐫𝐲),𝟔𝟓𝐌𝟕𝟎;𝟔𝟓𝐍𝟑𝟓(𝐒𝐞𝐜𝐨𝐧𝐝𝐚𝐫𝐲).\mathbf{2010~MSC:~65D25~(Primary),~65M70;~65N35~(Secondary).~}

1. INTRODUCTION

Fundamental results from approximation theory refers to the best uniform approximation of a smooth function by polynomials and the uniform approximation of a smooth 2π2\pi periodic function by trigonometric polynomials. These results are reviewed for instance in the monograph [1], Ch. 3. Thus, the Chebyshev equioscillation theorem states that a best approximation is unique for important classes of approximating functions but the set of nodes on which this approximation is realized is not necessarily unique. On the other hand, the spectral collocation methods essentially depend on the set of nodes on which the differential equation is collocated. In order to implement these methods one needs very accurate differentiation matrices of various orders.

Consequently, the accuracy at which the pseudospectral (collocation) differentiation matrices operate is of utmost importance in numerical analysis. In this note we will address the issue of the dependence of the accuracy of differentiation process on the node distribution in a grid covering a finite interval. We will consider an equispaced grid, an arbitrary one and then Legendre and Chebyshev grids. For non algebraic polynomials we will consider the Fourier interpolate.

2. ARBITRARY AND EQUIDISTANT GRIDS

It is well established that spectral collocation methods for solving differential equations is based on weighted interpolants of the form

u(x)pN1(x):=j=1Nα(x)α(xj)ϕj(x)uj,u(x)\approx p_{N-1}(x):=\sum_{j=1}^{N}\frac{\alpha(x)}{\alpha\left(x_{j}\right)}\phi_{j}(x)u_{j}, (1)

where uj:=u(xj),u:[a,b]u_{j}:=u\left(x_{j}\right),u:[a,b]\rightarrow\mathbb{R}, the set of interpolating functions ϕj(x),j=1,,N\phi_{j}(x),j=1,\ldots,N satisfy ϕj(xk):=δjk\phi_{j}\left(x_{k}\right):=\delta_{jk} (the Kronecker delta), the set of nodes xj,j=1,,Nx_{j},j=1,\ldots,N in [a,b][a,b]\subset\mathbb{R} is distinct but otherwise arbitrary and the weight α(x)\alpha(x) is an arbitrary continuously differentiable positive function (see for instance our contribution [3]). Typically, u(x)u(x) is the solution of an initial/boundary value problem.

The baricentric form of interpolation polynomial writes (see for instance the seminal paper [7])

pN1(x)=α(x)j=1Nwjxxjujα(xj)j=1Nwjxxj,p_{N-1}(x)=\frac{\alpha(x)\sum_{j=1}^{N}\frac{w_{j}}{x-x_{j}}\frac{u_{j}}{\alpha\left(x_{j}\right)}}{\sum_{j=1}^{N}\frac{w_{j}}{x-x_{j}}},

where wj1:=m=1,mjN(xjxm)w_{j}^{-1}:=\prod_{m=1,m\neq j}^{N}\left(x_{j}-x_{m}\right). This means that pN1(x)p_{N-1}(x) defined above is an interpolant of the function u(x)u(x) in the sense that

u(xk)=pN1(xk),k=1,,N.u\left(x_{k}\right)=p_{N-1}\left(x_{k}\right),k=1,\ldots,N.

The collocation derivative operators are generated by taking various order derivatives of (1) and evaluating them at nodes xk,k=1,,Nx_{k},k=1,\ldots,N, i.e.,

u(l)(xk)j=1Ndldxl[α(x)α(xj)ϕj(x)]x=xkuk,k=1,,N.u^{(l)}\left(x_{k}\right)\approx\sum_{j=1}^{N}\frac{d^{l}}{dx^{l}}\left[\frac{\alpha(x)}{\alpha\left(x_{j}\right)}\phi_{j}(x)\right]_{x=x_{k}}u_{k},k=1,\ldots,N.

Consequently, the ll- th order differentiation matrices associated to this operator are computed by

Dk,j(l)=dldxl[α(x)α(xj)ϕj(x)]x=xk,k,j=1,,N,l,D_{k,j}^{(l)}=\frac{d^{l}}{dx^{l}}\left[\frac{\alpha(x)}{\alpha\left(x_{j}\right)}\phi_{j}(x)\right]_{x=x_{k}},k,j=1,\ldots,N,l\in\mathbb{N}, (2)

where ϕj(x)\phi_{j}(x) are given by Lagrange’s formula

ϕj(x):=m=1,mjN(xxmxjxm),j=1,,N.\phi_{j}(x):=\prod_{m=1,m\neq j}^{N}\left(\frac{x-x_{m}}{x_{j}-x_{m}}\right),j=1,\ldots,N.

The approximation theory dictates that the set of nodes xj,j=1,,Nx_{j},j=1,\ldots,N cannot be just any set of nodes. The main aim of this note is to make this statement more clear. Thus we use the MATLAB code poldif.m from [7] in order to perform the differentiation in (2).

In order to quantify the performances of every set of nodes we compute two specific parameters, namely:

  • the norm of the error in approximating the zero vector, i.e., D(1)𝟏N\left\|D^{(1)}\cdot\mathbf{1}_{N}\right\| where 𝟏N:=ones(N,1);\mathbf{1}_{N}:=\operatorname{ones}(N,1);

  • the rank(D(1))\operatorname{rank}\left(D^{(1)}\right) for various values of approximation parameter NN.

Instead of the first parameter we could use another one reflecting the fact that the matrix D(1)D^{(1)} has to satisfy

j=1NDij(1)=0,1iN,\sum_{j=1}^{N}D_{ij}^{(1)}=0,1\leq i\leq N,

i.e., the derivative of a constant vanishes.

Let’s consider a set of equidistant nodes

xj:=j1N1,j=1,,N,x_{j}:=\frac{j-1}{N-1},j=1,\ldots,N, (3)

where NN takes in turn the value from the first row of Table 3.1. Thus the interval [0,1] is successively divided in N1N-1 subintervals each of length 1/(N1)1/(N-1).

Along with the equidistant grid (3) we consider first an arbitrary one, namely

x~j:=(j1N1)2,j=1,,N.\widetilde{x}_{j}:=\left(\frac{j-1}{N-1}\right)^{2},j=1,\ldots,N. (4)

It is fairly clear that this new grid is a non uniform one with nodes clustering to the left margin 0 . The extent at which the differentiation matrices perform on both grids is depicted in Fig. 1. The error in approximating the zero vector takes huge values. The collocation derivatives of the hat function and of a highly oscillatory but fairly smooth function, i.e., exp(sin(nx))\exp(\sin(nx)), with n=10n=10 on 20 equispaced nodes are depicted in Fig. 2. They show large oscillations which cluster to the ends of the interval [1,1][-1,1]. They are the direct consequence of the numerical instability of the differentiation process.

It is well known that given NN nodes each of the differentiating matrices should be rank N1N-1, a differentiating has the constant vector as its null space. Thus, it is important to point out that this equispaced approach works accurately for a very small number of nodes. As differentiating matrix D(1)D^{(1)} should be rank one deficient, this simple test shows that even for a very rough approximation D(1)D^{(1)} has additional nullspaces. Moreover, in case of quadratically spaced grid x~j\widetilde{x}_{j}, the differentiation matrices

𝐍\mathbf{N} 𝟏𝟏\mathbf{11} 𝟐𝟏\mathbf{21} 𝟑𝟏\mathbf{31} 𝟒𝟏\mathbf{41} 𝟓𝟏\mathbf{51} 𝟔𝟏\mathbf{61} 𝟕𝟏\mathbf{71} 𝟖𝟏\mathbf{81} 𝟗𝟏\mathbf{91} 𝟏𝟎𝟏\mathbf{101}
rank(D(1))(3)\operatorname{rank}\left(D^{(1)}\right)-(3) 10 20 30 37 42 9 8 8 7 7
rank(D(1))(4)\operatorname{rank}\left(D^{(1)}\right)-(4) 10 19 6 4 4 3 3 3 3 3
Table 1: Table 1: The evolution of rank deficiency of differentiation matrices for equidistant grid (3) and squared grid. (4)

become much more degenerated. Table 3.1 shows that the situation dramatically deteriorates as NN increases.

3. CONSECRATED GRIDS

In this section we will analyze some well known grids such as Legendre, Chebyshev and Fourier applied to a finite interval. First, let’s reconsider two illustrative examples, the Chebyshev and Legendre derivatives of the hat function h(x):=max(0,1abs(x))h(x):=\max(0,1-abs(x)) and of the smooth but fairly oscillatory function exp(sin(nx)),n>\exp(\sin(nx)),n> 2.

perform satisfactorily well. Our numerical experiments have showed that all differentiation matrices keep a rank of order N1N-1. Most notably, for NN larger than 700 the Legendre differentiation process rapidly becomes unstable.

The best situation with polynomial differentiation is encountered when Chebyshev nodes of second kind

xk:=cos((k1)πN1),k=1,,N,x_{k}:=\cos\left(\frac{(k-1)\pi}{N-1}\right),k=1,\ldots,N, (5)

or equivalently Chebyshev-Gauss-Lobatto quadrature nodes (see for instance [5] or our contribution [4] p. 11) are used. The corresponding differentiation matrix has the entries (see for instance [2], p. 69)

Dkj(1)={ck(1)j+kcj(xkxj),jk,j,k=1,2,,N,xk2(1xk2),j=k1,N,2(N1)2+16,j=k=1,2(N1)2+16,j=k=N.D_{kj}^{(1)}=\left\{\begin{array}[]{c}\frac{c_{k}(-1)^{j+k}}{c_{j}\left(x_{k}-x_{j}\right)},j\neq k,j,k=1,2,\ldots,N,\\ -\frac{x_{k}}{2\left(1-x_{k}^{2}\right)},j=k\neq 1,N,\\ \frac{2(N-1)^{2}+1}{6},j=k=1,\\ -\frac{2(N-1)^{2}+1}{6},j=k=N.\end{array}\right.

The above differences (xkxj)\left(x_{k}-x_{j}\right) may be subject to floating-point cancellation errors for large NN. Various tricks based on simple trigonometric identities have been used in [7] in order to avoid such errors in floating-point arithmetic. Thus, the MATLAB code chebdif.m has been fairly stable algorithm in computing these matrices.

The upper curve in Fig 5 correspond to this situation.

Beyond this polynomial differentiation we will pay a particular attention to the Fourier differentiation matrices (see [7]). The Fourier interpolate reads

tN(x):=j=1Nϕj(x)uj,t_{N}(x):=\sum_{j=1}^{N}\phi_{j}(x)u_{j},

where

ϕj(x):=1NsinN2(xxj)cot12(xxj),N even ϕj(x):=1NsinN2(xxj)csc12(xxj),N odd ,j=1,2,,N.\begin{gathered}\phi_{j}(x):=\frac{1}{N}\sin\frac{N}{2}\left(x-x_{j}\right)\cot\frac{1}{2}\left(x-x_{j}\right),N\text{ even }\\ \phi_{j}(x):=\frac{1}{N}\sin\frac{N}{2}\left(x-x_{j}\right)\csc\frac{1}{2}\left(x-x_{j}\right),N\text{ odd },j=1,2,\ldots,N.\end{gathered}

Using the baricentric form of the interpolate (see [6] Sect. 13.6) the MATLAB code fourdif.m from [7] provides the Fourier differentiation matrices on the nodes

xk:=(k1)h,h=2πN,k=1,,N.x_{k}:=(k-1)h,h=\frac{2\pi}{N},k=1,\ldots,N.

Their performances are the best as it is apparent from Fig. 5 (see the lower curve). For N=O(26)N=O\left(2^{6}\right) it is of utmost importance to underline that Fourier and even Chebyshev differentiation matrices work fairly close to the machine precision. Excellent approximations are also attained when the cut off parameter ranges up to 2112^{11}. It is also important to notice that all differentiation matrices conserve a correct rank. It is a practical illustration of the spectral accuracy.

4. CONCLUDING REMARKS

In ([7]) p. 478 the authors state that no general error analysis applicable to differentiation process on arbitrary grids has been undertaken. We hope that the present note fills this gap at least partially. Fourier and Chebyshev differentiation matrices have proved to be fairly reliable. This facts explain to some extent the success of the collocation spectral methods based on them.

References

[1] Atkinson, K., Han, W., Theoretical Numerical Analysis. A Functional Analysis Framework, Third Ed., Springer 2009.
[2] Canuto, C., Hussaini, M.Y., Quarteroni, A., Zang, T.A., Spectral Methods in Fluid Dynamics, Springer Verlag, Berlin, 1988.
[3] Gheorghiu, C.I., Spectral Methods for Differential Problems, Casa Cartii de Stiinta Publishing House, Cluj-Napoca, 2007.
[4] Gheorghiu, C.I., Spectral Methods for Non-Standard Eigenvalue Problems. Fluid and Structural Mechanics and Beyond, Springer Briefs in Mathematics, 2014.
[5] Gottlieb, D., Orszag, S.A., Numerical Analysis of Spectral Methods: Theory and Applications, SIAM Philadelphia, 1977.
[6] Henrici, P., Applied and Computational Complex Analysis: Discrete Fourier Analysis-Cauchy Integrals-Construction of Conformal Maps-Univalent Functions, Vol. 3 John Wiley and Sons, Inc., New York, 1986.
[7] Weideman, J.A.C., Reddy, S.C. A MATLAB Differentiation Matrix Suite, ACM Trans. on Math. Software, 26, 465-519 (2000).

2014

Related Posts