Lecture 4: Piecewise Cubic Interpolation

Similar documents
Lecture 4: Piecewise Cubic Interpolation

CMDA 4604: Intermediate Topics in Mathematical Modeling Lecture 19: Interpolation and Quadrature

Lecture 20: Numerical Integration III

Orthogonal Polynomials and Least-Squares Approximations to Functions

Discrete Least-squares Approximations

Lecture 14: Quadrature

Numerical Analysis: Trapezoidal and Simpson s Rule

Review of Calculus, cont d

Chapter 3 Polynomials

NUMERICAL INTEGRATION. The inverse process to differentiation in calculus is integration. Mathematically, integration is represented by.

Numerical Analysis. Doron Levy. Department of Mathematics Stanford University

Orthogonal Polynomials

Numerical Methods I Orthogonal Polynomials

Lecture 6: Singular Integrals, Open Quadrature rules, and Gauss Quadrature

Definite integral. Mathematics FRDIS MENDELU. Simona Fišnarová (Mendel University) Definite integral MENDELU 1 / 30

Definite integral. Mathematics FRDIS MENDELU

The Riemann Integral

Construction of Gauss Quadrature Rules

Advanced Computational Fluid Dynamics AA215A Lecture 3 Polynomial Interpolation: Numerical Differentiation and Integration.

Best Approximation. Chapter The General Case

NUMERICAL INTEGRATION

University of Houston, Department of Mathematics Numerical Analysis II

A REVIEW OF CALCULUS CONCEPTS FOR JDEP 384H. Thomas Shores Department of Mathematics University of Nebraska Spring 2007

The Regulated and Riemann Integrals

1 Error Analysis of Simple Rules for Numerical Integration

Numerical integration

1.9 C 2 inner variations

Abstract inner product spaces

Numerical Integration

Physics 116C Solution of inhomogeneous ordinary differential equations using Green s functions

Best Approximation in the 2-norm

3.4 Numerical integration

Lecture 12: Numerical Quadrature

Calculus of Variations

Math& 152 Section Integration by Parts

Introduction to Finite Element Method

Matrices, Moments and Quadrature, cont d

Theoretical foundations of Gaussian quadrature

Czechoslovak Mathematical Journal, 55 (130) (2005), , Abbotsford. 1. Introduction

Lecture Note 4: Numerical differentiation and integration. Xiaoqun Zhang Shanghai Jiao Tong University

We know that if f is a continuous nonnegative function on the interval [a, b], then b

Undergraduate Research

Solutions to Assignment #8

1 The Riemann Integral

New Expansion and Infinite Series

Lecture 17. Integration: Gauss Quadrature. David Semeraro. University of Illinois at Urbana-Champaign. March 20, 2014

Partial Derivatives. Limits. For a single variable function f (x), the limit lim

20 MATHEMATICS POLYNOMIALS

1. Gauss-Jacobi quadrature and Legendre polynomials. p(t)w(t)dt, p {p(x 0 ),...p(x n )} p(t)w(t)dt = w k p(x k ),

4. Calculus of Variations

Chapter 6. Riemann Integral

The Fundamental Theorem of Calculus

Numerical Analysis. 10th ed. R L Burden, J D Faires, and A M Burden

Lecture 19: Continuous Least Squares Approximation

Chapter 28. Fourier Series An Eigenvalue Problem.

The Wave Equation I. MA 436 Kurt Bryan

Review of Gaussian Quadrature method

Quantum Physics II (8.05) Fall 2013 Assignment 2

1 2-D Second Order Equations: Separation of Variables

Lecture 14 Numerical integration: advanced topics

1 The Lagrange interpolation formula

Chapter 4. Additional Variational Concepts

MA 124 January 18, Derivatives are. Integrals are.

1 1D heat and wave equations on a finite interval

x j β j + λ (x ij x j )βj + λ β c2 and y aug = λi λi = X X + λi, X λi = y X.

1 Ordinary Differential Equations

Riemann is the Mann! (But Lebesgue may besgue to differ.)

B.Sc. in Mathematics (Ordinary)

Lecture 23: Interpolatory Quadrature

Math 554 Integration

Chapter 3 Solving Nonlinear Equations

Introduction to Numerical Analysis

MATH34032: Green s Functions, Integral Equations and the Calculus of Variations 1

DOING PHYSICS WITH MATLAB MATHEMATICAL ROUTINES

Math 473: Practice Problems for the Material after Test 2, Fall 2011

Chapter 1. Basic Concepts

LECTURE 3. Orthogonal Functions. n X. It should be noted, however, that the vectors f i need not be orthogonal nor need they have unit length for

8 Laplace s Method and Local Limit Theorems

COT4501 Spring Homework VII

For a continuous function f : [a; b]! R we wish to define the Riemann integral

c n φ n (x), 0 < x < L, (1) n=1

Taylor Polynomial Inequalities

P 3 (x) = f(0) + f (0)x + f (0) 2. x 2 + f (0) . In the problem set, you are asked to show, in general, the n th order term is a n = f (n) (0)

Space Curves. Recall the parametric equations of a curve in xy-plane and compare them with parametric equations of a curve in space.

Integrals - Motivation

1.3 The Lemma of DuBois-Reymond

Numerical Integration

Orthogonal functions

Riemann Sums and Riemann Integrals

Math 520 Final Exam Topic Outline Sections 1 3 (Xiao/Dumas/Liaw) Spring 2008

Advanced Calculus: MATH 410 Uniform Convergence of Functions Professor David Levermore 11 December 2015

MATH , Calculus 2, Fall 2018

Main topics for the First Midterm

Notes on length and conformal metrics

Riemann Sums and Riemann Integrals

INTRODUCTION TO INTEGRATION

Math 113 Exam 1-Review

Chapter 8: Methods of Integration

Numerical Integration

III. Lecture on Numerical Integration. File faclib/dattab/lecture-notes/numerical-inter03.tex /by EC, 3/14/2008 at 15:11, version 9

Transcription:

Lecture notes on Vritionl nd Approximte Methods in Applied Mthemtics - A Peirce UBC Lecture 4: Piecewise Cubic Interpoltion Compiled 5 September In this lecture we consider piecewise cubic interpoltion in which cubic polynomil pproximtion is ssumed over ech subintervl In order to obtin sufficient informtion to determine these coefficients, we require continuity of the interpolting polynomils in neighboring intervls s well s the continuity of number of derivtives Depending on the number of derivtives tht we require to be continuous t the stitching points we obtin different pproximtion schemes in which dditionl dt bout the function fx being pproximted might hve to be furnished in order tht there is sufficient dt to determine the coefficients of the cubic polynomils Key Concepts: Piecewise cubic interpoltion, Cubic Splines, Cubic Hermite Interpoltion 4 Piecewise Cubic Interpoltion 4 Degree of freedom nlysis of piecewise cubic interpolnts Consider the domin [, b] tht is prtitioned into N intervls hving N + nodes nd N internl nodes In ech of these subintervls ssume tht different cubic polynomil is to be constructed Let p 3,N x be the combintion of ll these cubic polynomils We now discuss the lterntive pproximtion schemes tht one obtins depending on the different schemes of constrint Schemes of constrint: Piecewise Cubic Hermite polynomils: p 3,N x nd p 3,N x re continuous t interior nodes There re four unknown coefficients for ech of the N intervls nd N constrints due to the continuity requirements on p 3,N x nd p 3,N x DOF : 4N N = N + specify function vlue nd its derivtive t ll N + nodes Hve to specify f & f t ll N + nodes! Cubic Spline: p 3,N x, p 3,N x, nd p 3,N x re ll continuous t interior points DOF : 4N 3N = N + 3 = N + }{{} + specify f t ll N + nodes nd impose EXTRA CONDITIONS The extr conditions re up to the user to prescribe depending on the ppliction, eg p 3x = = p 3x N whics clled the nturl spline

4 Piecewise Cubic Hermite polynomils x = x x N = L DOF: 4N N = N + prescribe fx i nd f x i t i =,, N Representtion of f in terms of Hermite bsis functions h i x nd h i x: N N fx hx = fx i h i x + f x i h i x where h d i x j = δ ij nd dx h i x j = δ ij d dx h i x j = h i x j = Constructing bsis functions on the cnonicl intervl [, ]: i= i= } We use the liner Lgrnge bsis functions N ξ = +ξ ξ : N ξ b = δ b, ξ,b = ± h h h Let h ξ = α ξ + β [N ξ] ; h ξ = α ξ + β[n ξ] h ξ = γ ξ + δ [N ξ] ; h ξ = γ ξ + δ [N ξ] - h ξ To find α i, β i, γ i nd δ i we impose the conditions : = h = β α = h = α + β α = α β α = nd β = h ξ = 4 + ξ ξ Similrly h ξ = 4 ξ + ξ For the derivtive bsis functions = h = δ γ = h = γ δ } Similrly h ξ = 4 ξ + ξ δ = γ = h ξ = 4 + ξ ξ

Expressions for bsis functions on n rbitrry intervl [x i, x i+ ] Interpoltion 3 Use the liner trnsformtion xξ = x i N ξ + x i+n ξ = x i ξ + x i+ + ξ xi + x i+ = + x i+ x i ξ The inverse trnsformtion is: ξx = x x i + x i+ x i+ x i = x x i + x i+ x i + ξ = x i+ x i + x x i x i+ = x x i x i+ x i x i+ x i + ξ = x i + x x i x i ξ = x i+ x ξ = x i + x i+ x x i+ x i x i Here x i = x i+ x i nd observe tht h i x = [ x i + x x i ] x i+ x x i 3 4 h i+ x = [ x i + x i+ x] x x i x i 3 4 h i x = x x ix i+ x x i 43 h i+ x = x i+ xx x i x i 44 d dξ ξ = d dx ξx dx dξ = d dx ξx x i Error involved: For function vlues the error is given by: while for derivtives the error is : fx hx f 4 x 4 384 f x h x f 4 3 x 3 6

4 43 Piecewise Cubic Spline interpoltion NDOF: 4N 3N = N + + specify fx i t x,, x N + extr conditions 43 Derivtion using Cubic Hermie interpoltion Since we hve similr piecewise cubic polynomils to the Piecewise Cubic Hermite polynomils on ech subintervl but with dditionl continuity required t the N interior nodes, our strting point is the Hermite cubic bsis expnsion We then impose dditionl conditions to mke up for the derivtives f x i which re not known or required in the cse of splines On [x k, x k+ ] x k x k x k+ [ x k + x x k ] x k+ x [ x k + x k+ x] x x k sx = f k x k 3 + f k+ x k 3 +s x x k x k+ x k x k + s x x k+ x x k k+ x k where the f k nd f k+ from the Hermite expnsion hve been replced by the unknown quntities s k nd s k+ which re to be determined by system of equtions which ensure tht x is continuous t internl nodes The first nd second derivtives of sx must be continuous t the interieor points x j, j = N Continuity of the first derivtive is lredy obtined by our choice of bsis functions So we pply continuity of x to get equtions for the coefficients s k Tht is, we clculte s x on the two intervls [x k, x k ] nd [x k, x k+ ] nd require continuity t x k After some lgebr x k s k + x k + x k s k + x k s k+ = 3f[x k, x k+ ] x k + f[x k, x k ] x k We hve N equtions nd N + unknowns s, s,, s N so we need more conditions Sy we specify I f = s nd s N = f N then on uniform mesh x k = x: 4 s 4 s 4 4 s N = 3 f[x, x ] + f[x, x ] f[x, x 3 ] + f[x, x ] f[x N, x N ] + f[x N, x N ] s s N A tridigonl system of equtions esy to solve!

Interpoltion 5 43 Alterntive cubic spline derivtion for derivtive primry vribles y i y i+ Y i x x i x i+ Let Y i x = i x x i 3 + b i x x i + c i x x i + d i Y i x = 3 i x x i + b i x x i + c i Y i x = 6 i x x i + b i y i = Y i x i = d i y i+ = Y i x i+ = i h 3 i + b i h i + c i + y i where = x i+ x i Let s i = Y i x i = c i s i+ = Y i x i+ = 3 i h i + b i + s i Y i x i = b i = Y ix i = 6 i + b i [ ] [ ] [ h 3 i h i i yi+ y 3h = i s i h ] i i b i s i+ s i / / i = y i+ y i s i h 4 i s i+ s ih i h 4 i 6 y i { b i = h 3 i s i+ s i 3h i y i+ y i s i } / h 4 i yi+ y i i = h 3 + s i+ + s i i h i yi+ y i s b i = 3 i+ + s i h i s i+ + s i = y i + 6 s i + s i + 6 y i s i + s i 6 y i + y i = s i+ + 4 s i + 4 s i + s i s i+ + + s i + s i = 3f[x i, x i ] + f[x i, x i+ ]

6 433 Another spline derivtion with i y i y i y i+ s primry vribles Y i x Y i x Y i+ x x i x i x i+ Let Y i x = i x x i 3 + b i x x i + c i x x i + d i Y i x = 3 i x x i + b i x x i + c i Y i x = 6 i x x i + b i t x i : y i = Y i x i = d i interpoltes the function t x i 45 y i+ = Y i x i+ = i h 3 i + b i h i + c i + y i enforce continuity 46 Introduce primry vrible : i = Y i x i = b i b i = / 47 Build in continuity of Y i+ = Y i x i+ = 6 i + i i = s Impose continuity of first derivtives: c i = y i i i+ s i s i+ Y i x = s i x x i 3 + s 6 x x i + c i x x i + y i s i+ y i+ = s i h 3i + s i 6 + c i + y i yi+ y i s i+ c i = s i s i 6 hi = y i s i+ + s i 6 s Y i+ + s i 6 Y i x i = 3 i x i x i + b i x i x i + c i = c i ix i = 3 i h i + b i + c i s = 3 i i 6 h i + i + { yi 6 48 s i + s 6 i } or i 3 + 6 + + i + i+ = 6 yi yi i + + i + i+ = 6 yi yi i =, N EXTRA CONDITIONS N EQ

434 Extr Conditions y y y n x h x x h n x N X N Nturl Spline: = = N two extr condtions Interpoltion 7 h + h h h h + h h h N h N h N + h N N = 6 y y h y y h y 3y h yy h y N y N h N y Ny N h N Clmped Spline: Specified first derivtives Given f x = A nd f x n = B A = Y x = c = y y h h s + h 6 = A h + h = 6 y y h A B = Y Nx n = 3 n h n + b n h n + c n sn s n = 3 h n + s n h n + y n y n hn n + h n n 6h n h n 6 6 B y n y n = 3h n n 3h n n + 6h n n h n n h n n h n 6 B y ny n h n = h n n + h n n But h + h + h + h = 6 {[f [x, x ] f [x, x ]} h h h h + h h h n h n + h n h n h n h n N N = 6 y y /h A y y /h yy h y n y n /h n y n y n /h n B y ny n y h n

8 3 Qudrtic boundry intervl representtion = s s 6h qudrtic = N = N = n = s N s N 6h N qudrtic 3h + h h h h + h h 4 Liner extrpoltion h N3 + h N h N h N h N + 3h N N = 6 f[x, x ] f[x, x ] f[x N, x N f[x N, x N ] S x S S S x x x = s = h h h h + h + h + h = 6f[x, x ] f[x, x ] = h + h h h h + h h h + h h + h s + h = RHS h h h h + h h h + h + h = RHS h h +h h h h + h h h h h h + h h h h

Interpoltion 9 5 Not--knot condition Y x Y x Y N x Y N x Unknowns = 4N Constrints = 3N 3 4N 3N 3 = N + unknowns the vlues t x,, x N i + + i + i+ = 6f[x, x ] f[x, x ] Y x = x x 3 + b x x + c x x + d Y x = 3 x x + b x x + c Y x = 6 x x + b, x x = h s = Y x = 6 x x + 6h / = h + h = h + h h h h But h + h + h + h = 6f[x, x ] f[x, x ] + h h + h + h h h Also + h N h N + h N N + h N h N h N h + h = 6f[x, x ] f[x, x ] h N + h N N = 6f[x N, x N ] f[x N, x N ] + h h h + h h h h + h h h + h h 6 A periodic spline: h N h N h N + h N x + = x N x + = x N h N + h N h N h N + h N N N

III Smoothness property of nturl spline x = = x N In order to impose this condition it is convenient to consider the k s unknowns in which cse the equtions become: x k k + x k + x k+ k + x k+ k+ = 6f[x k, x k+ ] f[x k, x k ] k =,, N NOTE: Importnt identity: y [y + ] = y y + = y Let yx be ny other interpolnt of fx t x,, x N then y dx Now dx = y dx = y s y dx + = y s = y s b b b y dx N x k y s dx = const on ech subintervl k= x k N x k c k y s botnterpolnts k= If we choose s : = = b for exmple or if y nd s botnterpolte f t nd b then y dx = y dx + x k dx dx Thus s is the interpolnt with the MINIMUM CURVATURE ie smoothest Error involved in spline interpoltion: fx = sx f 4 5 x4 384 f x s x f 4 x 3 4 f x i s x i f 5 x 4 6 y dx = x = mx x : for nonuniform points nd ll x [x, x N ] for nonuniform points nd ll x [x, x N ] for uniform smple points x i cubic spline provides n excellent technique for NUMERICAL DIFFERENTIATION

Interpoltion How do we solve for the { k }? d c d c 3 d 3 d n c n n dn x x x n = b b n d d x + c x = b 4 d x + d x + c x 3 = b 4 d c x + c x 3 = b b d d d x + c x 3 = b d = d d c b = b d b Similrly d k+x k+ + c k+ x k+ = b k+ 43 where d k+ = d k+ k+ d k c k b k+ = b k+ k+ d b k 44 k d c d c d n c n d n x x n = b b b n Bck Substitution x n = b n/d n x n = b n c n x/d n x n = b n/d n 45 x k = b k c k x k+ /d k k = n,, 46

Note, if we let m k = k d k then A = m m n d c cn d n LU = LU Forwrd Ly = b y = L b Bck Ux = y Substitution