Rational Function Approximation
Total Page:16
File Type:pdf, Size:1020Kb
Approximation Theory Pad´eApproximation Numerical Analysis and Computing Lecture Notes #13 — Approximation Theory — Rational Function Approximation Joe Mahaffy, [email protected] Department of Mathematics Dynamical Systems Group Computational Sciences Research Center San Diego State University San Diego, CA 92182-7720 http://www-rohan.sdsu.edu/∼jmahaffy Spring 2010 Joe Mahaffy, [email protected] Rational Function Approximation — (1/21) Approximation Theory Pad´eApproximation Outline 1 Approximation Theory Pros and Cons of Polynomial Approximation New Bag-of-Tricks: Rational Approximation Pad´eApproximation: Example #1 2 Pad´eApproximation Example #2 Finding the Optimal Pad´eApproximation Joe Mahaffy, [email protected] Rational Function Approximation — (2/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Polynomial Approximation: Pros and Cons. Advantages of Polynomial Approximation: [1] We can approximate any continuous function on a closed inter- val to within arbitrary tolerance. (Weierstrass approximation theorem) Joe Mahaffy, [email protected] Rational Function Approximation — (3/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Polynomial Approximation: Pros and Cons. Advantages of Polynomial Approximation: [1] We can approximate any continuous function on a closed inter- val to within arbitrary tolerance. (Weierstrass approximation theorem) [2] Easily evaluated at arbitrary values. (e.g. Horner’s method) Joe Mahaffy, [email protected] Rational Function Approximation — (3/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Polynomial Approximation: Pros and Cons. Advantages of Polynomial Approximation: [1] We can approximate any continuous function on a closed inter- val to within arbitrary tolerance. (Weierstrass approximation theorem) [2] Easily evaluated at arbitrary values. (e.g. Horner’s method) [3] Derivatives and integrals are easily determined. Joe Mahaffy, [email protected] Rational Function Approximation — (3/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Polynomial Approximation: Pros and Cons. Advantages of Polynomial Approximation: [1] We can approximate any continuous function on a closed inter- val to within arbitrary tolerance. (Weierstrass approximation theorem) [2] Easily evaluated at arbitrary values. (e.g. Horner’s method) [3] Derivatives and integrals are easily determined. Disadvantage of Polynomial Approximation: [1] Polynomials tend to be oscillatory, which causes errors. This is sometimes, but not always, fixable: — E.g. if we are free to select the node points we can minimize the interpolation error (Chebyshev polynomials), or optimize for integration (Gaussian Quadrature). Joe Mahaffy, [email protected] Rational Function Approximation — (3/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Moving Beyond Polynomials: Rational Approximation We are going to use rational functions, r(x), of the form n i pi x p(x) i=0 r(x)= = m q(x) i 1+ qi x j=1 and say that the degree of such a function is N = n + m. Joe Mahaffy, [email protected] Rational Function Approximation — (4/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Moving Beyond Polynomials: Rational Approximation We are going to use rational functions, r(x), of the form n i pi x p(x) i=0 r(x)= = m q(x) i 1+ qi x j=1 and say that the degree of such a function is N = n + m. Since this is a richer class of functions than polynomials — rational functions with q(x) 1 are polynomials, we expect that rational ≡ approximation of degree N gives results that are at least as good as polynomial approximation of degree N. Joe Mahaffy, [email protected] Rational Function Approximation — (4/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation Extension of Taylor expansion to rational functions; selecting the (k) (k) pi ’s and qi ’s so that r (x )= f (x ) k = 0, 1,..., N. 0 0 ∀ p(x) f (x)q(x) p(x) f (x) r(x)= f (x) = − − − q(x) q(x) Joe Mahaffy, [email protected] Rational Function Approximation — (5/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation Extension of Taylor expansion to rational functions; selecting the (k) (k) pi ’s and qi ’s so that r (x )= f (x ) k = 0, 1,..., N. 0 0 ∀ p(x) f (x)q(x) p(x) f (x) r(x)= f (x) = − − − q(x) q(x) ∞ i Now, use the Taylor expansion f (x) ai (x x ) , for ∼ i=0 − 0 simplicity x0 = 0: ∞ m n a xi q xi p xi i i − i i=0 i=0 i=0 f (x) r(x)= . − q(x) Joe Mahaffy, [email protected] Rational Function Approximation — (5/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation Extension of Taylor expansion to rational functions; selecting the (k) (k) pi ’s and qi ’s so that r (x )= f (x ) k = 0, 1,..., N. 0 0 ∀ p(x) f (x)q(x) p(x) f (x) r(x)= f (x) = − − − q(x) q(x) ∞ i Now, use the Taylor expansion f (x) ai (x x ) , for ∼ i=0 − 0 simplicity x0 = 0: ∞ m n a xi q xi p xi i i − i i=0 i=0 i=0 f (x) r(x)= . − q(x) Next, we choose p0, p1,..., pn and q1, q2,..., qm so that the numerator has no terms of degree N. ≤ Joe Mahaffy, [email protected] Rational Function Approximation — (5/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation: The Mechanics. For simplicity we (sometimes) define the “indexing-out-of-bounds” coefficients: pn = pn = = pN = 0 +1 +2 ··· qm = qm = = qN = 0, +1 +2 ··· so we can express the coefficients of xk in ∞ m n i i i ai x qi x pi x = 0, k = 0, 1,..., N − i=0 i=0 i=0 as k ai qk−i = pk , k = 0, 1,..., N. i=0 Joe Mahaffy, [email protected] Rational Function Approximation — (6/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation: Abstract Example 1 of 2 Find the Pad´eapproximation of f (x) of degree 5, where f (x) a + a x + ... a x5 is the Taylor expansion of f (x) about ∼ 0 1 5 the point x0 = 0. The corresponding equations are: x0 a p = 0 0 − 0 x1 a q + a p = 0 0 1 1 − 1 x2 a q + a q + a p = 0 0 2 1 1 2 − 2 x3 a q + a q + a q + a p = 0 0 3 1 2 2 1 3 − 3 x4 a q + a q + a q + a q + a p = 0 0 4 1 3 2 2 3 1 4 − 4 x5 a q + a q + a q + a q + a q + a p = 0 0 5 1 4 2 3 3 2 4 1 5 − 5 Note: p0 = a0!!! (This reduces the number of unknowns and equations by one (1).) Joe Mahaffy, [email protected] Rational Function Approximation — (7/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation: Abstract Example 2 of 2 We get a linear system for p1, p2,..., pN and q1, q2,..., qN : a0 q1 p1 a1 a1 a0 q2 p2 a2 a a a q p = a . 2 1 0 3 − 3 − 3 a a a a q p a 3 2 1 0 4 4 4 a a a a a q p a 4 3 2 1 0 5 5 5 If we want n = 3, m = 2: a0 q1 p1 a1 a1 a0 q2 p2 a2 a a a 0 p = a . 2 1 0 − 3 − 3 a a a a 0 0 a 3 2 1 0 4 a a a a a 0 0 a 4 3 2 1 0 5 Joe Mahaffy, [email protected] Rational Function Approximation — (8/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation: Abstract Example 2 of 2 We get a linear system for p1, p2,..., pN and q1, q2,..., qN : a0 q1 p1 a1 a1 a0 q2 p2 a2 a a a q p = a . 2 1 0 3 − 3 − 3 a a a a q p a 3 2 1 0 4 4 4 a a a a a q p a 4 3 2 1 0 5 5 5 If we want n = 3, m = 2: a 1 q 0 a 0 − 1 1 a1 a0 q2 p2 a2 a a 0 p p = a . 2 1 1 − 3 − 3 a a 0 a 0 0 a 3 2 0 4 a a 0 a a 0 0 a 4 3 1 0 5 Joe Mahaffy, [email protected] Rational Function Approximation — (8/21) Pros and Cons of Polynomial Approximation Approximation Theory New Bag-of-Tricks: Rational Approximation Pad´eApproximation Pad´eApproximation: Example #1 Pad´eApproximation: Abstract Example 2 of 2 We get a linear system for p1, p2,..., pN and q1, q2,..., qN : a0 q1 p1 a1 a1 a0 q2 p2 a2 a a a q p = a .