710 likes | 774 Views
Explore polynomial interpolation in Lagrange and Newton forms, error estimation, Hermite interpolation, and numerical solutions for differential equations using finite element approach in 1D and 2D.
E N D
Generalized Finite Element Methods Polynomial interpolation Suvranu De
In this class Interpolation Polynomial interpolation Lagrange form Newton form Interpolation error estimate Piecewise polynomial interpolation (the finite element idea) in 1 and 2D Hermite interpolation
Numerical solution recipe • Have to solve a set of differential equations Au=f • subject to boundary conditions Bu=0 • Step 1: Interpolation/Approximation :approximate unknown u(x) as a linear combination of a bunch of known functionsj1(x), j2(x),.. • uh(x) = j1(x) a1+ j2(x) a2+... jN(x) aN • The functions j1(x), j2(x),... • Polynomials/piecewise polynomials • Moving least squares (MLS) • Reproducing kernel functions • Partition of unity (PU) functions • Wavelet functions, • etc
Numerical solution recipe The residual r(x)=Auh-f 0 Step 2: Residual minimization :strive to “minimize” the residual. e.g., Point collocation Subdomain collocation Galerkin Petrov-Galerkin H-1 Methods
f(x) u2 u1 x un u0 xn x0 x1 x2 Interpolation Given n+1 points (xi,ui), i=0,….,n find a function f(x) such that “f(x) interpolates {ui } at the nodes {xi}” f(xi)=ui only at the n+1 points
Interpolation Polynomial interpolation: if f(x) is an algebraic polynomial Trigonometric interpolation: if f(x) is a trigonometric polynomial Piecewise polynomial interpolation: if f(x) is locally a polynomial Why find the interpolation?
Polynomial interpolation Lagrange form Given: points x0, x1 and values u0 , u1. Find a linear function (polynomial of degree one) P1(x) = a0 + a1x that interpolates the data u u1 u0 x x0= 0 x1 = 1 u0= P1(x0) = a0 u1= P1(x1) = a0 + a1 i.e., a0 = u0 and a1 = u1–u0 is the equation of the green line joining the two points P1(x) = u0+ (u1–u0)x
Polynomial interpolation Lagrange form u P1(x) = u0+ (u1–u0)x Can be rewritten as u1 u0 P1(x) = (1-x) u0+ (x) u1 x x0= 0 x1 = 1 Lagrange form u 1-x x 1 x x0= 0 x1 = 1 A linear interpolation can be expressed as a linear combination of Lagrange polynomials of degree one
Polynomial interpolation Lagrange form u Properties: 1. The Lagrange polynomial at node ‘i’ has a value of unity at that node and a value of zero at all the other nodes (Kronecker delta property) 1 1-x x x x0= 0 x1 = 1 2. The Lagrange polynomials satisfy the Partition of unity property 3. Higher order polynomial reproduction property
Polynomial interpolation Lagrange form So I can represent a constant and a linear function using Linear combinations of Lagrange polynomials of degree one. Can I represent a quadratic ? How would the Lagrange polynomials look for u u2 u0 u1 x x0= 0 x2 = 1 x1 = 0.5 What are the properties of these polynomials?
Polynomial interpolation Lagrange form General case: Given n+1distinct points x0, x1...., xn and n+1 corresponding values u0, u1...., un, there exists a unique polynomial Pn(x)of degree at mostn, such that ui=Pn(xi) for i=0,1,....,n where Therefore
Polynomial interpolation Lagrange form In matrix form Vandermonde matrix The system has a unique solution iff the Vandermonde matrix is nonsingular. • The Vandermonde matrix is nonsingular iff the nodes are distinct (what is det(P)?) • The interpolating polynomial is unique
Polynomial interpolation Lagrange form Lagrange form is a polynomial of degree ‘n’..why?
Polynomial interpolation Lagrange form • Properties • Kronecker delta property: • 2. Partition of unity property (p=0) • 3. Higher order polynomial reproduction property (consistency):
Polynomial interpolation Reproducing Property Proof of Reproducing property : Any function in the “basis” can be exactly reproduced Want to show: How? Now set
Polynomial interpolation Reproducing property the ‘1’ is at the qth location
Polynomial interpolation Lagrange form Nicer form of Lagrange polynomial at node ‘i’ Can you prove this? Nodal polynomial Another form of the Lagrange polynomial
Polynomial interpolation Lagrange form Example:
Polynomial interpolation Lagrange form Lagrange form of the interpolating polynomial Summarizing: is the unique polynomial interpolating n+1 distinct points
Polynomial interpolation Newton form For computational purposes, the Lagrange form is not very efficient u P1(x) = (1-x) u0+ (x) u1 u1 u0 x x0= 0 x1 = 1 P2(x) = Ughh!! have to recalculate Plug in one more point u u1 u2 u0 x x0= 0 x1 = 1 x2 = 2
Polynomial interpolation Newton form u u1 u2 u0 x x0= 0 x1 = 1 x2 = 2 Would be nice if we could write P2(x) = P1(x) + q2(x) Poly of deg 2 Poly of deg 1 q2(x) is a poly of degree 2.
Polynomial interpolation Newton form q2(x) = P2(x) - P1(x) At the nodes x0 and x1 q2(x0) = P2(x0) - P1(x0) = u0 - u0= 0 q2(x1) = P2(x1) - P1(x1) = u1 – u1= 0 q2(x) =C2(x-x0)(x-x1) = C2 w2(x) Nodal polynomial How to compute C2? q2(x2) = P2(x2) - P1(x2) = u2 - P1(x2) Hence,
Polynomial interpolation Newton form In the general case we have a recursive algorithm: Step 1: Compute Step 2: Compute the correction term qn(x) = Cn wn(x) Step 3:Pn(x) = Pn-1(x) + qn(x) Nodal polynomial
Polynomial interpolation Error estimate Question: If data points are discrete samples of a continuous function, then how well does the polynomial interpolant approximate that function between the sample points? Error estimate (see handout) : Let I be an interval containing the n+1 points Let f(x) be a real valued function with continuous derivatives of order (n+1) for all x in I. Let Pnf(x) be the polynomial that interpolates at the points x0 , x1,....,xn .Then the interpolation error at any point x on I is Nodal polynomial What is the error at the nodal points?
Polynomial interpolation Error estimate Since the point x is unknown, result is not particularly useful unless bound on appropriate derivate of f(x) is known. Ifand then it can be proved that This error estimate is quite deceptive and must be carefully considered.
Polynomial interpolation Uniform interpolation of a “gentle” function 4 points
Polynomial interpolation Uniform interpolation of a “gentle” function 6 points
Polynomial interpolation Uniform interpolation of a “gentle” function 8 points
Polynomial interpolation Uniform interpolation of a “gentle” function 12 points
Polynomial interpolation Uniform interpolation of a “gentle” function 16 points
Polynomial interpolation Uniform grid Polynomial interpolation on uniform grid is generally a bad idea from two perspectives: ERROR: The approximation may not only fail to converge, but may diverge the error estimate depends on : (1) The behavior of the nodal polynomial (2) The behavior of STABILITY: Due to ill conditioning, polynomial approximation may become unstable if there is small perturbation in the data
Polynomial interpolation Runge phenomenon Uniform grid of 12 points
Polynomial interpolation Runge phenomenon Uniform grid of 24 points
Polynomial interpolation Runge phenomenon What is the problem? For uniform grid Hence, polynomial interpolation on equispaced points may not only fail to converge as n ∞, but may become worse. This is known as Runge phenomenon. This problem may be circumvented by using nonuniform nodal spacing (e.g., Chebyshev points)
Example Higher-order Polynomial interpolation Equispaced points Max(|wn+1(x)|)=1
Example Higher-order Polynomial interpolation Equispaced points Max(|wn+1(x)|)=0.384888
Example Higher-order Polynomial interpolation Equispaced points Max(|wn+1(x)|)=0.1974826389
Example Higher-order Polynomial interpolation Equispaced points Max(|wn+1(x)|)=0.1134701568
Example Higher-order Polynomial interpolation Equispaced points Max(|wn+1(x)|)=3.260020369173742 x 10-4
Example Higher-order Polynomial interpolation Equispaced points Max(|wn+1(x)|)=2.286554486330441 x 10-4
Example Higher-order Polynomial interpolation Equispaced points
Example Higher-order Polynomial interpolation Equispaced points • Polynomial interpolation on equispaced points: • Max(|wn+1(x)|) decreases monotonically on the interval [-1 1] with increase in ‘n’ • The maximum error occurs at the ends. • The error in the middle of the interval in MUCH less than the error at the two ends. • Conclusion: • Polynomial interpolation on equispaced points in not the brightest idea. • Need to choose the nodes such that error is more equitably distributed and the maximum error on the interval is minimized.
Stability Higher-order Polynomial interpolation Equispaced points In addition to error, higher order polynomial interpolation on equispaced grid may become unstable if there is perturbation in data (e.g., due to round off) If is the perturbed set of data points corresponding to and and are the corresponding polynomial interpolants, then is the Lebesgue constant. For polynomial interpolation on equispaced points
Chebyshev points Chebyshev points
Example Higher-order Polynomial interpolation Chebyshev points Max(|wn+1(x)|)=3.814697265624998 x 10-6
Example Higher-order Polynomial interpolation Chebyshev points Chebyshev Theorem: For all polynomials of degree n+1 and leading coefficient 1, the unique polynomial that has the smallest uniform norm on [-1,1] is the (n+1)th Chebyshev polynomial divided by 2n
Example Higher-order Polynomial interpolation Chebyshev points Error estimate for Chebyshev points Stability The Lebesgue constant is also much smaller
Higher-order Polynomial interpolation Conclusions • Remedy: • Utilize nonuniform data points (e.g., Chebyshev points) • Use low-order piece-wise polynomial interpolation • Use low-order polynomial least-squares fit.
0 1 h h h h h h 0 1 Piecewise Lagrange interpolation (the Finite Element idea!) Trying to fit a lot of points with a poly of high degree on equispaced points produces unwanted wiggles (bad idea!). Good idea: Partition the interval [a,b] into subintervals (elements) and use piece-wise polynomial on each subinterval You get rid of wiggles but lose in smoothness of approximation
Piecewise linear interpolation (the Finite Element idea) shape functions A linear interpolation can be expressed as a linear combination of Lagrange polynomials of degree one u u nodes x/h (h-x)/h 1 u1 u0 x x x0= 0 x1 = h x0= 0 x1 = h element 1 u u u1 u2 u0 1 x x x0= 0 x2 = 2h x1 = h x0= 0 x1 = 1 element 1 element 2