VLSF / SNO

Spectral Neural Operator
Creative Commons Zero v1.0 Universal
67 stars 6 forks source link

Derivatives and integrals with Chebyshev's modes #2

Closed MaxGhi8 closed 8 months ago

MaxGhi8 commented 8 months ago

Good morning, could I ask you for some explanation or reference on how you calculated derivatives and integrals with Chebyshev's modes in functions/Chebyshev.py. Thank you in advance.

Best regards, Massimiliano

VLSF commented 8 months ago

Dear Massimiliano,

There are a lot of ways to compute integrals and derivatives with Chebyshev nodes.

  1. For definite integration, the way to go is to apply the Clenshaw–Curtis quadrature (see also remarkable article [1]).
  2. For indefinite integration, one applies a spectral integration matrix (the method in [2] is equivalent to what is used in the code).
  3. For differentiation in "x-space" one can apply a spectral differentiation matrix.
  4. For differentiation in the spectral space one can: a. apply the method described in [2] (not used in the code) b. (this is used in the code) combine the expression for derivative [4] (derivative of T expressed using U) with the relation between polynomials of the first and the second kind [5] (T expressed with U) c. use expression 2.49 from section 2.4.5 in [6]
  5. There is also a beautiful way explained in [7]. It uses two bases, so one should be careful applying it, but it is powerful and useful.

[1] -- Trefethen LN. Is Gauss quadrature better than Clenshaw–Curtis?. SIAM review. 2008;50(1):67-87. [2] -- Greengard L. Spectral integration and two-point boundary value problems. SIAM Journal on Numerical Analysis. 1991 Aug;28(4):1071-80. [3] -- Trefethen LN. Spectral methods in MATLAB. Society for industrial and applied mathematics; 2000 Jan 1. [4] -- https://en.wikipedia.org/wiki/Chebyshev_polynomials#Differentiation_and_integration [5] -- https://en.wikipedia.org/wiki/Chebyshev_polynomials#Relations_between_the_two_kinds_of_Chebyshev_polynomials [6] -- Mason JC, Handscomb DC. Chebyshev polynomials. CRC Press; 2002 Sep 17. [7] -- Olver S, Townsend A. A fast and well-conditioned spectral method. SIAM review. 2013;55(3):462-89.

MaxGhi8 commented 8 months ago

Thank you very much for your very detailed and careful reply.

Best regards, Massimiliano