Beyond Chebyshev technology Strathclyde, 25th June 2015 26th Biennial Numerical Analysis Conference Alex Townsend MIT Joint work with Nick Hale and Sheehan Olver Beyond Chebyshev technology Strathclyde, 25th June 2015 26th Biennial Numerical Analysis Conference Alex Townsend MIT Joint work with Nick Hale and Sheehan Olver Beyond Chebyshev technology Strathclyde, 25th June 2015 26th Biennial Numerical Analysis Conference Alex Townsend MIT Joint work with Nick Hale and Sheehan Olver Introduction Chebfun stands for Chebyshev fun Chebfun = Chebyshev fun Chebyshev technology: A powerful approach for numerically computing with functions. It is based on (piecewise) polynomial interpolation at Chebyshev points and Chebyshev polynomials: xj “ cospjπ{nq, 0 ď j ď n, Tk px q “ cospk cos´1 x q There exist fast, accurate algorithms for integration, differentiation, rootfinding, minimization, solution of ODEs, etc. Alex Townsend @ MIT 1/17 Introduction Chebyshev technology is powerful Chebyshev interpolant of fpxq: n ÿ f px q « pn px q “ ck T k p x q , pn pxj q “ f pxj q, xj “ chebpts k “0 Powerful concepts: FFT, barycentric formula, colleague matrix, collocation SIAM digit challenge problem 3 2 2 0.5 v 0 y -2 2 −0.5 0 0.5 [Trefethen, 02] Alex Townsend @ MIT 2 0 0 -2 2 -2 2 0 −1 2 −2 −0.5 2 1 0 −1 −1 Computing spherical choreographies Inverse transform sampling 1 1 −3 −3 -2 -2 −2 −1 2 0 x 1 2 2 3 -2 -2 [Olver & T., 14] -2 -2 [Montanelli & Gushterov, 15] 2/17 Introduction Chebyshev technology can also bring us together Chebyshev technology can also bring us together. My friends: « 45 peer-reviewed publications, « 5 essays, and a book called ATAP. Alex Townsend @ MIT 3/17 Introduction Characters: Standard orthogonal polynomials on r´1, 1s Name Notation w px q Chebyshev polynomials (of 1st kind) Tk px q p1 ´ x 2 q´1{2 Chebyshev polynomials (of 2nd kind) Uk px q p1 ´ x 2 q1{2 Legendre polynomials Pk px q 1 Ultraspherical polynomials Ck px q pλq p1 ´ x 2 qλ´1{2 Fast transforms now available for Legendre and ultraspherical technology [Hale & T., 2014], [Hale & T., 2015] Alex Townsend @ MIT 4/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Introduction Talk overview and a trivial example Fact: Chebyshev polynomials satisfy: ż1 ´1 $ ’ &π, Tj px qTk px q a dx “ π{2, ’ % 1 ´ x2 0, j “ k “ 0, j “ k ą 0, j , k. Inconvenience: The 1st coeff of a Chebyshev series is treated as special: ż 8 ÿ 1 2 1 f px qTk px q a f px q “ a0 T0 px q ` dx. ak T k p x q , ak “ 2 π ´1 1 ´ x2 k “1 Alternative: Chebyshev polynomials of the 2nd kind: # ż1 a π{2, Uj px qUk px q 1 ´ x 2 dx “ 0, ´1 j “ k, j , k. Results: Saves your sanity and avoids mistakes. Alex Townsend @ MIT 5/17 Example 1 Convolution Fact: The Fourier transform of Tk px q is complicated: ż1 Tk px qe ´iωx dx “ complicated, [Fokas & Smitheman, 12]. ´1 Inconvenience: Convolution cannot be based on the convolution theorem: ż minp1,x `1q h px q “ pf ˚ g qpx q “ f pt qg px ´ t qdt. 1 ÝÑ maxp´1,x ´1q t ÝÑ x ´1 ´2 Alex Townsend @ MIT Quadrature is expensive. 0 2 6/17 Example 1 Convolution Fact: The Fourier transform of Tk px q is complicated: ż1 Tk px qe ´iωx dx “ complicated, [Fokas & Smitheman, 12]. ´1 Inconvenience: Convolution cannot be based on the convolution theorem: ż minp1,x `1q h px q “ pf ˚ g qpx q “ f pt qg px ´ t qdt. 1 ÝÑ maxp´1,x ´1q t ÝÑ x ´1 ´2 Alex Townsend @ MIT Quadrature is expensive. 0 2 6/17 Example 1 Convolution Fact: The Fourier transform of Tk px q is complicated: ż1 Tk px qe ´iωx dx “ complicated, [Fokas & Smitheman, 12]. ´1 Inconvenience: Convolution cannot be based on the convolution theorem: ż minp1,x `1q h px q “ pf ˚ g qpx q “ f pt qg px ´ t qdt. 1 ÝÑ maxp´1,x ´1q t ÝÑ x ´1 ´2 Alex Townsend @ MIT Quadrature is expensive. 0 2 6/17 Example 1 Convolution Fact: The Fourier transform of Tk px q is complicated: ż1 Tk px qe ´iωx dx “ complicated, [Fokas & Smitheman, 12]. ´1 Inconvenience: Convolution cannot be based on the convolution theorem: ż minp1,x `1q h px q “ pf ˚ g qpx q “ f pt qg px ´ t qdt. 1 ÝÑ maxp´1,x ´1q t ÝÑ x ´1 ´2 Alex Townsend @ MIT Quadrature is expensive. 0 2 6/17 Example 1 Convolution Fact: The Fourier transform of Tk px q is complicated: ż1 Tk px qe ´iωx dx “ complicated, [Fokas & Smitheman, 12]. ´1 Inconvenience: Convolution cannot be based on the convolution theorem: ż minp1,x `1q h px q “ pf ˚ g qpx q “ f pt qg px ´ t qdt. 1 ÝÑ maxp´1,x ´1q t ÝÑ x ´1 ´2 Alex Townsend @ MIT Quadrature is expensive. 0 2 6/17 Example 1 Convolution (cont.) Alternative: The Fourier transform of Pk px q is convenient [Hale & T., 2014]: ż1 Pk px qe ´iωx dx “ 2p´i qk jk pωq, rDLMF, p18.17.19qs, ´1 where jk pωq “ spherical Bessel function. Theorem (Convolution theorem) Let m and n be integers. Then, ż 2p´i qm`n 8 pPm ˚ Pn qpx q “ jm pωqjn pωqe iωx , π ´8 f and g in Pk basis f ˚ g in Pk basis Alex Townsend @ MIT Fourier transform jm pωq “ spherical Bessel. f̂ and ĝ in jk basis Inverse f̂ ˆ ĝ in jk basis transform 7/17 Example 1 Convolution (cont.) Alternative: The Fourier transform of Pk px q is convenient [Hale & T., 2014]: ż1 Pk px qe ´iωx dx “ 2p´i qk jk pωq, rDLMF, p18.17.19qs, ´1 where jk pωq “ spherical Bessel function. Theorem (Convolution theorem) Let m and n be integers. Then, ż 2p´i qm`n 8 pPm ˚ Pn qpx q “ jm pωqjn pωqe iωx , π ´8 f and g in Pk basis f ˚ g in Pk basis Alex Townsend @ MIT Fourier transform jm pωq “ spherical Bessel. f̂ and ĝ in jk basis Inverse f̂ ˆ ĝ in jk basis transform 7/17 Example 1 Convolution (cont.) Alternative: The Fourier transform of Pk px q is convenient [Hale & T., 2014]: ż1 Pk px qe ´iωx dx “ 2p´i qk jk pωq, rDLMF, p18.17.19qs, ´1 where jk pωq “ spherical Bessel function. Theorem (Convolution theorem) Let m and n be integers. Then, ż 2p´i qm`n 8 pPm ˚ Pn qpx q “ jm pωqjn pωqe iωx , π ´8 f and g in Pk basis f ˚ g in Pk basis Alex Townsend @ MIT Fourier transform jm pωq “ spherical Bessel. f̂ and ĝ in jk basis Inverse f̂ ˆ ĝ in jk basis transform 7/17 Example 1 Convolution (cont.) Alternative: The Fourier transform of Pk px q is convenient [Hale & T., 2014]: ż1 Pk px qe ´iωx dx “ 2p´i qk jk pωq, rDLMF, p18.17.19qs, ´1 where jk pωq “ spherical Bessel function. Theorem (Convolution theorem) Let m and n be integers. Then, ż 2p´i qm`n 8 pPm ˚ Pn qpx q “ jm pωqjn pωqe iωx , π ´8 f and g in Pk basis f ˚ g in Pk basis Alex Townsend @ MIT Fourier transform jm pωq “ spherical Bessel. f̂ and ĝ in jk basis Inverse f̂ ˆ ĝ in jk basis transform 7/17 Example 1 Convolution (cont.) Alternative: The Fourier transform of Pk px q is convenient [Hale & T., 2014]: ż1 Pk px qe ´iωx dx “ 2p´i qk jk pωq, rDLMF, p18.17.19qs, ´1 where jk pωq “ spherical Bessel function. Theorem (Convolution theorem) Let m and n be integers. Then, ż 2p´i qm`n 8 pPm ˚ Pn qpx q “ jm pωqjn pωqe iωx , π ´8 f and g in Pk basis f ˚ g in Pk basis Alex Townsend @ MIT Fourier transform jm pωq “ spherical Bessel. f̂ and ĝ in jk basis Inverse f̂ ˆ ĝ in jk basis transform 7/17 Example 1 Convolution (cont.) Results: Computational timings 3 10 Mollification of rough signals Quadrature New 2 Computation time 10 OpN 3 q 1 10 OpN 2 q 0 10 −1 10 −2 10 1 10 2 10 3 10 N 4 10 5 10 Now used in the conv(f, g) command in Chebfun. Alex Townsend @ MIT 8/17 Example 2 Solving differential equations Fact: The derivative of a Chebyshev polynomial satisfies: # řk ´1 2k j odd Tj px q, k “ even, řk ´1 Tk1 px q “ 2k j even Tj px q ´ 1, k “ odd. Inconvenience: The Chebyshev-tau spectral method leads to dense matrices. For example, du ` 4xu “ 0 up´1q “ c, dx ¨ ˆ ˆ ˚ ˚ ˚ ˚ ˆ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˝ ˆ ˆ ˆ ˆ ˆ ˆ ˆ .. ˆ ˛¨ u0 ˛ ˆ ... .. . ‹˚ ˆ ‹˚ ‹˚ ˚ ˆ ‹ ‹˚ .. ‹ ˚ ˚ . ‹ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ˆ ‹˚ ‚˝ u1 ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹“˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‚ ˝ . .. ˆ . ˆ .. . ˆ ˆ Alex Townsend @ MIT ¨¨¨ ˆ ˆ ¨ ˆ ˆ u2 .. . .. . un´1 c ˛ ‹ 0 ‹ ‹ 0 ‹ ‹ ‹ ‹ .. ‹ . . ‹ .. ‹ ‹ . ‹ ‹ ‚ 0 9/17 Example 2 Solving differential equations Fact: The derivative of a Chebyshev polynomial satisfies: # řk ´1 2k j odd Tj px q, k “ even, řk ´1 Tk1 px q “ 2k j even Tj px q ´ 1, k “ odd. Inconvenience: The Chebyshev-tau spectral method leads to dense matrices. For example, du ` 4xu “ 0 up´1q “ c, dx ¨ ˆ ˆ ˚ ˚ ˚ ˚ ˆ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˝ ˆ ˆ ˆ ˆ ˆ ˆ ˆ .. ˆ ˛¨ u0 ˛ ˆ ... .. . ‹˚ ˆ ‹˚ ‹˚ ˚ ˆ ‹ ‹˚ .. ‹ ˚ ˚ . ‹ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ˆ ‹˚ ‚˝ u1 ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹“˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‚ ˝ . .. ˆ . ˆ .. . ˆ ˆ Alex Townsend @ MIT ¨¨¨ ˆ ˆ ¨ ˆ ˆ u2 .. . .. . un´1 c ˛ ‹ 0 ‹ ‹ 0 ‹ ‹ ‹ ‹ .. ‹ . . ‹ .. ‹ ‹ . ‹ ‹ ‚ 0 9/17 Example 2 Solving differential equations Fact: The derivative of a Chebyshev polynomial satisfies: # řk ´1 2k j odd Tj px q, k “ even, řk ´1 Tk1 px q “ 2k j even Tj px q ´ 1, k “ odd. Inconvenience: The Chebyshev-tau spectral method leads to dense matrices. For example, du ` 4xu “ 0 up´1q “ c, dx ¨ ˆ ˆ ˚ ˚ ˚ ˚ ˆ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˝ ˆ ˆ ˆ ˆ ˆ ˆ ˆ .. ˆ ˛¨ u0 ˛ ˆ ... .. . ‹˚ ˆ ‹˚ ‹˚ ˚ ˆ ‹ ‹˚ .. ‹ ˚ ˚ . ‹ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ˆ ‹˚ ‚˝ u1 ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹“˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‚ ˝ . .. ˆ . ˆ .. . ˆ ˆ Alex Townsend @ MIT ¨¨¨ ˆ ˆ ¨ ˆ ˆ u2 .. . .. . un´1 c ˛ ‹ 0 ‹ ‹ 0 ‹ ‹ ‹ ‹ .. ‹ . . ‹ .. ‹ ‹ . ‹ ‹ ‚ 0 9/17 Example 2 Solving differential equations Fact: The derivative of a Chebyshev polynomial satisfies: # řk ´1 2k j odd Tj px q, k “ even, řk ´1 Tk1 px q “ 2k j even Tj px q ´ 1, k “ odd. Inconvenience: The Chebyshev-tau spectral method leads to dense matrices. For example, du ` 4xu “ 0 up´1q “ c, dx ¨ ˆ ˆ ˚ ˚ ˚ ˚ ˆ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˝ ˆ ˆ ˆ ˆ ˆ ˆ ˆ .. ˆ ˛¨ u0 ˛ ˆ ... .. . ‹˚ ˆ ‹˚ ‹˚ ˚ ˆ ‹ ‹˚ .. ‹ ˚ ˚ . ‹ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ˆ ‹˚ ‚˝ u1 ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹“˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‚ ˝ . .. ˆ . ˆ .. . ˆ ˆ Alex Townsend @ MIT ¨¨¨ ˆ ˆ ¨ ˆ ˆ u2 .. . .. . un´1 c ˛ ‹ 0 ‹ ‹ 0 ‹ ‹ ‹ ‹ .. ‹ . . ‹ .. ‹ ‹ . ‹ ‹ ‚ 0 9/17 Example 2 Solving differential equations (cont.) Alternative: Let differentiation convert to ultraspherical bases. [Olver & T., 2013] p1 q p2q Tk1 px q “ kCk ´1 px q, p3q Tk2 px q “ 2kCk ´2 px q, Tk3 px q “ 8kCk ´3 px q. For example, du ` 4xu “ 0 dx ¨ 1 ˚ ˚ ˚ ˚ 2 ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˝ ´1 1 2 ´1 ´1 p´1qn´1 .. ´1 3 . .. ´1 . 1 .. . n´3 1 ´1 n´2 1 Alex Townsend @ MIT ¨¨¨ ´1 2 1 1 up´1q “ c, n´1 ¨ ˛¨ u0 ˛ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‚˝ u1 ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹“˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‚ ˝ u2 .. . .. . un´1 c ˛ ‹ 0 ‹ ‹ 0 ‹ ‹ ‹ ‹ ‹ .. ‹ . . ‹ .. ‹ ‹ . ‹ ‹ ‹ ‚ 0 10/17 Example 2 Solving differential equations (cont.) Alternative: Let differentiation convert to ultraspherical bases. [Olver & T., 2013] p1 q p2q Tk1 px q “ kCk ´1 px q, p3q Tk2 px q “ 2kCk ´2 px q, Tk3 px q “ 8kCk ´3 px q. For example, du ` 4xu “ 0 dx ¨ 1 ˚ ˚ ˚ ˚ 2 ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˝ ´1 1 2 ´1 ´1 p´1qn´1 .. ´1 3 . .. ´1 . 1 .. . n´3 1 ´1 n´2 1 Alex Townsend @ MIT ¨¨¨ ´1 2 1 1 up´1q “ c, n´1 ¨ ˛¨ u0 ˛ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‚˝ u1 ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹“˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‚ ˝ u2 .. . .. . un´1 c ˛ ‹ 0 ‹ ‹ 0 ‹ ‹ ‹ ‹ ‹ .. ‹ . . ‹ .. ‹ ‹ . ‹ ‹ ‹ ‚ 0 10/17 Example 2 Solving differential equations (cont.) Alternative: Let differentiation convert to ultraspherical bases. [Olver & T., 2013] p1 q p2q Tk1 px q “ kCk ´1 px q, p3q Tk2 px q “ 2kCk ´2 px q, Tk3 px q “ 8kCk ´3 px q. For example, du ` 4xu “ 0 dx ¨ 1 ˚ ˚ ˚ ˚ 2 ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˚ ˝ ´1 1 2 ´1 ´1 p´1qn´1 .. ´1 3 . .. ´1 . 1 .. . n´3 1 ´1 n´2 1 Alex Townsend @ MIT ¨¨¨ ´1 2 1 1 up´1q “ c, n´1 ¨ ˛¨ u0 ˛ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‹˚ ‚˝ u1 ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹“˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‹ ˚ ‚ ˝ u2 .. . .. . un´1 c ˛ ‹ 0 ‹ ‹ 0 ‹ ‹ ‹ ‹ ‹ .. ‹ . . ‹ .. ‹ ‹ . ‹ ‹ ‹ ‚ 0 10/17 Example 2 Solving differential equations (cont.) Results: [Olver & T., 2013], [T. & Olver, 2015] u1 px q ` x 3 upx q “ 100 sinp20,000x 2 q, ∇2 u ` 5000p2 ´ y qu “ 0, up´1q “ 0. u|BΩ “ 1. 1.2 1 u(x) 0.8 degree(u) = 20391 time “ 1.21s 0.6 0.4 time = 15.5s 0.2 0 −0.2 −1 Alex Townsend @ MIT −0.5 0 x 0.5 1 11/17 Example 2 Solving differential equations (future work) Results (in the pipeline, perhaps?): ∇2 u ` 500p1 ´ y qu “ ´1, Ω “ penrose, u |B Ω “ 0 Using an extension of Hierarchical Poincare–Steklov scheme [Martinsson 2012]. Alex Townsend @ MIT 12/17 Example 3 Best low rank approximation Fact: Chebyshev polynomials are not orthogonal in the L 2 inner-product: ż1 Tj px qTk px qdx , 0, j , k. ´1 Inconvenience: Tasks connected to L 2 -orthogonality are awkward. Best least squares poly. approx.: }f px q ´ n ÿ ck Tk px q}L 2 “ min. k “0 Best low-rank approximation: }f px, y q ´ r ÿ σj uj py qvj px q}L 2 “ min. j “1 Alex Townsend @ MIT 13/17 Example 3 Best low rank approximation Fact: Chebyshev polynomials are not orthogonal in the L 2 inner-product: ż1 Tj px qTk px qdx , 0, j , k. ´1 Inconvenience: Tasks connected to L 2 -orthogonality are awkward. Best least squares poly. approx.: }f px q ´ n ÿ ck Tk px q}L 2 “ min. k “0 Best low-rank approximation: }f px, y q ´ r ÿ σj uj py qvj px q}L 2 “ min. j “1 Alex Townsend @ MIT 13/17 Example 3 Best low rank approximation Fact: Chebyshev polynomials are not orthogonal in the L 2 inner-product: ż1 Tj px qTk px qdx , 0, j , k. ´1 Inconvenience: Tasks connected to L 2 -orthogonality are awkward. Best least squares poly. approx.: }f px q ´ n ÿ ck Tk px q}L 2 “ min. k “0 Best low-rank approximation: }f px, y q ´ r ÿ σj uj py qvj px q}L 2 “ min. j “1 Alex Townsend @ MIT 13/17 Example 3 Best low rank approximation Fact: Chebyshev polynomials are not orthogonal in the L 2 inner-product: ż1 Tj px qTk px qdx , 0, j , k. ´1 Inconvenience: Tasks connected to L 2 -orthogonality are awkward. Best least squares poly. approx.: }f px q ´ n ÿ ck Tk px q}L 2 “ min. k “0 Best low-rank approximation: }f px, y q ´ r ÿ σj uj py qvj px q}L 2 “ min. j “1 Alex Townsend @ MIT 13/17 Example 3 Best low rank approximation (cont.) Alternative: The Pk px q basis is orthogonal wrt. the L 2 inner-product: ż1 Pj px qPk px qdx “ 0, j , k. ´1 For best least squares poly. approx. of degree n: 8 ÿ f px q “ leg ak Pk px q ñ k “0 }f ´ n ÿ leg ak Pk px q}L 2 “ min. k “0 For best low-rank approximation: f px, y q “ m ÿ n ÿ j “0 k “0 Cjk Pj py qPk px q ñ f px, y q “ r ÿ σj uj py qvj px q jloooooooomoooooooon “1 Computed via the discrete svd of C Alex Townsend @ MIT 14/17 Example 3 Best low rank approximation (cont.) Alternative: The Pk px q basis is orthogonal wrt. the L 2 inner-product: ż1 Pj px qPk px qdx “ 0, j , k. ´1 For best least squares poly. approx. of degree n: 8 ÿ f px q “ leg ak Pk px q ñ k “0 }f ´ n ÿ leg ak Pk px q}L 2 “ min. k “0 For best low-rank approximation: f px, y q “ m ÿ n ÿ j “0 k “0 Cjk Pj py qPk px q ñ f px, y q “ r ÿ σj uj py qvj px q jloooooooomoooooooon “1 Computed via the discrete svd of C Alex Townsend @ MIT 14/17 Example 3 Best low rank approximation (cont.) Alternative: The Pk px q basis is orthogonal wrt. the L 2 inner-product: ż1 Pj px qPk px qdx “ 0, j , k. ´1 For best least squares poly. approx. of degree n: 8 ÿ f px q “ leg ak Pk px q ñ k “0 }f ´ n ÿ leg ak Pk px q}L 2 “ min. k “0 For best low-rank approximation: f px, y q “ m ÿ n ÿ j “0 k “0 Cjk Pj py qPk px q ñ f px, y q “ r ÿ σj uj py qvj px q jloooooooomoooooooon “1 Computed via the discrete svd of C Alex Townsend @ MIT 14/17 Example 3 Best low rank function approximation (cont.) Results: Best least squares approx. of degree 15 f px q “ Alex Townsend @ MIT Best rank 3 approx. 1 1`100x 2 15/17 Bonus example Gauss quadrature The race for high order Gauss–Legendre quadrature, in SIAM News [T., 14] tic, [x, w] = legpts( 10 ); toc Elapsed time is 0.001256 seconds. tic, [x, w] = legpts( 100 ); toc Elapsed time is 0.001289 seconds. tic, [x, w] = legpts( 1000000 ); toc Elapsed time is 0.140018 seconds. Similar advances in jacpts(), hermpts(), and lagpts(). [Hale & T., 14], [T., Trogdon, & Olver, 15], [Glaser, Lui, & Rokhlin, 07] Ignace Bogaert Alex Townsend @ MIT 16/17 Conclusion and a thank you using Legendre technology “80% of the time use Tk , otherwise use something else” Alex Townsend @ MIT 17/17 Conclusion and a thank you using Legendre technology “80% of the time use Tk , otherwise use something else” Alex Townsend @ MIT Rank 1 Rank 2 Rank 3 Rank 4 Rank 5 Rank 15 17/17