Numerical quadrature based on interpolating functions: A MATLAB implementation

Similar documents
Lecture 14: Quadrature

Lecture 14 Numerical integration: advanced topics

1 The Lagrange interpolation formula

Orthogonal Polynomials

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

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

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

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

Numerical Analysis: Trapezoidal and Simpson s Rule

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

Best Approximation. Chapter The General Case

Numerical Integration

COT4501 Spring Homework VII

Discrete Least-squares Approximations

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 ),

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

3.4 Numerical integration

Matrices, Moments and Quadrature, cont d

THE HANKEL MATRIX METHOD FOR GAUSSIAN QUADRATURE IN 1 AND 2 DIMENSIONS

Orthogonal Polynomials and Least-Squares Approximations to Functions

Interpolation. Gaussian Quadrature. September 25, 2011

Unit #9 : Definite Integral Properties; Fundamental Theorem of Calculus

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

Theoretical foundations of Gaussian quadrature

Abstract inner product spaces

Best Approximation in the 2-norm

Numerical integration

COSC 3361 Numerical Analysis I Numerical Integration and Differentiation (III) - Gauss Quadrature and Adaptive Quadrature

Definite integral. Mathematics FRDIS MENDELU

Numerical Integration

Review of Calculus, cont d

Construction of Gauss Quadrature Rules

Math& 152 Section Integration by Parts

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

Numerical Integration. 1 Introduction. 2 Midpoint Rule, Trapezoid Rule, Simpson Rule. AMSC/CMSC 460/466 T. von Petersdorff 1

NUMERICAL INTEGRATION

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

Numerical Methods I Orthogonal Polynomials

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

Review of Gaussian Quadrature method

Lecture Notes: Orthogonal Polynomials, Gaussian Quadrature, and Integral Equations

Section 7.1 Integration by Substitution

The Riemann Integral

Lecture 23: Interpolatory Quadrature

Advanced Calculus: MATH 410 Notes on Integrals and Integrability Professor David Levermore 17 October 2004

Chapter 3 Polynomials

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

Trapezoidal Rule, n = 1, x 0 = a, x 1 = b, h = b a. f (x)dx = h 2 (f (x 0) + f (x 1 )) h3

Exam 2, Mathematics 4701, Section ETY6 6:05 pm 7:40 pm, March 31, 2016, IH-1105 Instructor: Attila Máté 1

B.Sc. in Mathematics (Ordinary)

CAAM 453 NUMERICAL ANALYSIS I Examination There are four questions, plus a bonus. Do not look at them until you begin the exam.

Chapter 5. Numerical Integration

Euler, Ioachimescu and the trapezium rule. G.J.O. Jameson (Math. Gazette 96 (2012), )

7.2 The Definite Integral

Numerical Integration

Modern Methods for high-dimensional quadrature

How can we approximate the area of a region in the plane? What is an interpretation of the area under the graph of a velocity function?

Monte Carlo method in solving numerical integration and differential equation

1 The Riemann Integral

different methods (left endpoint, right endpoint, midpoint, trapezoid, Simpson s).

Z b. f(x)dx. Yet in the above two cases we know what f(x) is. Sometimes, engineers want to calculate an area by computing I, but...

DOING PHYSICS WITH MATLAB MATHEMATICAL ROUTINES

AN INTEGRAL INEQUALITY FOR CONVEX FUNCTIONS AND APPLICATIONS IN NUMERICAL INTEGRATION

The Regulated and Riemann Integrals

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

Numerical Analysis. Doron Levy. Department of Mathematics Stanford University

221B Lecture Notes WKB Method

Math 1B, lecture 4: Error bounds for numerical methods

Lecture 19: Continuous Least Squares Approximation

8 Laplace s Method and Local Limit Theorems

x = b a n x 2 e x dx. cdx = c(b a), where c is any constant. a b

INTRODUCTION TO INTEGRATION

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2019

Chapter 0. What is the Lebesgue integral about?

Arithmetic Mean Derivative Based Midpoint Rule

1 Error Analysis of Simple Rules for Numerical Integration

Chapter 2. Numerical Integration also called quadrature. 2.2 Trapezoidal Rule. 2.1 A basic principle Extending the Trapezoidal Rule DRAWINGS

6.5 Numerical Approximations of Definite Integrals

New Expansion and Infinite Series

Chapters 4 & 5 Integrals & Applications

APPROXIMATE INTEGRATION

Undergraduate Research

Lecture 20: Numerical Integration III

Definite Integrals. The area under a curve can be approximated by adding up the areas of rectangles = 1 1 +

The final exam will take place on Friday May 11th from 8am 11am in Evans room 60.

Introduction to Numerical Analysis. Hector D. Ceniceros

MAA 4212 Improper Integrals

Calculus II: Integrations and Series

Improper Integrals. Type I Improper Integrals How do we evaluate an integral such as

Numerical Integration. Newton Cotes Formulas. Quadrature. Newton Cotes Formulas. To approximate the integral b

Section 4.8. D v(t j 1 ) t. (4.8.1) j=1

Module 11.4: nag quad util Numerical Integration Utilities. Contents

The Fundamental Theorem of Calculus. The Total Change Theorem and the Area Under a Curve.

Quadrature Rules for Evaluation of Hyper Singular Integrals

221A Lecture Notes WKB Method

Numerical integration. Quentin Louveaux (ULiège - Institut Montefiore) Numerical analysis / 10

p(x) = 3x 3 + x n 3 k=0 so the right hand side of the equality we have to show is obtained for r = b 0, s = b 1 and 2n 3 b k x k, q 2n 3 (x) =

Week 10: Riemann integral and its properties

Sections 5.2: The Definite Integral

Chapter 3 Solving Nonlinear Equations

Transcription:

SEMINAR REPORT Numericl qudrture bsed on interpolting functions: A MATLAB implementtion by Venkt Ayylsomyjul A seminr report submitted in prtil fulfillment for the degree of Mster of Science (M.Sc) in Computtionl Mechnics of Mterils nd Structures to the Institute for Non-Liner Mechnics University of Stuttgrt December 2016

Contents 1 Introduction 1 2 Description 3 2.1 Composite-Trpezoidl method............................ 3 2.2 Composite-Simpson method.............................. 4 2.3 Generlized Closed Newton-Cotes qudrture method............... 5 2.4 Gussin Qudrture.................................. 6 2.4.1 Guss-Chebyshev qudrture......................... 7 2.4.2 Guss-Hermite qudrture........................... 8 2.4.3 Guss-Lguerre qudrture.......................... 8 2.4.4 Guss-Legendre qudrture.......................... 9 2.4.5 Guss-Lobtto qudrture........................... 9 i

Chpter 1 Introduction Computtion of closed-form ntiderivtives tht re encountered in mny engineering phenomen, is not lwys possible. The lck of n nlyticl solution motivtes numericl pproximtion of the integrl. Numericl integrtion or qudrture is the computtion of n pproximte solution to the definite integrl b f(x)dx to considerble degree of ccurcy. Depending on the behviour of f(x) in the rnge of integrtion, vrious methods my be pplied. In this work, methods pertining to one-dimensionl integrls re described. The function f(x) is known s the integrnd. Numericl qudrture methods cn be defined in generl s the weighted sum of evlutions of the integrnd t finite set of points clled integrtion points or nodes. b f(x)dx k w i f(x i ) i=1 The nodes(x i ) nd weights(w i ) vry ccording to the method nd desired ccurcy. The present work focuses on qudrture rules tht re built on interpolting functions tht re computtionlly efficient to integrte. Polynomils re suitble choice for the interpolting function. The methods tht re described in this document re: Composite-Trpezoidl method Composite-Simpson method Generlized Closed Newton-Cotes method Guss-Chebyshev method Guss-Hermite method Guss-Legendre method 1

Introduction 2 Guss-Lguerre method Guss-Lobtto method The corresponding methods hve been implemented in MATLAB in n intuitive mnner. The im of this implementtion is to compute the nodes nd weights ccording to the user input t run-time. This document explins the underlying theory of the bove mentioned methods.

Chpter 2 Description In this chpter, the description of methods mentioned in Chpter 1, long with the underlying theory nd necessry mthemticl preliminries re presented. 2.1 Composite-Trpezoidl method The Composite-Trpezoidl method, n extension of the 2-point Trpezoidl rule, pproximtes the re under the grph of the function f(x) s series of trpezoids nd computes the re (Fig 2.1). This is chieved by dividing the given intervl into n sub-intervls, pply the 2-point trpezoidl rule for ech sub-intervl nd perform summtion over the results. f(x) b Figure 2.1: Illustrtion of Composite-trpezoidl rule This enhnces the ccurcy of the result considerbly. Also, this rule converges fster when the integrnd is periodic function. The interpolting function is polynomil of degree 1. 3

Description 4 To compute the numericl integrl of function f(x) from to b using the Composite-Trpezoidl method, the following procedure cn be dopted: Divide the rnge of integrtion into n sub-intervls, tht gives step size h = (b )/n The integrtion points or nodes (excluding the limits) cn be written s x k = + kh (k = 1, 2, 3,..., n 1) The integrl cn now be evluted s b f(x)dx (b ) n ( ) n 1 f() + f(x k ) + f(b) 2 2 k=1 (2.1) This method is implemented in the MATLAB function CTrp. 2.2 Composite-Simpson method This is n extension of the 3-point Simpson method. If the integrnd is non-smooth function (oscilltory, discontinuous t few points) over the given rnge, the ccurcy of the result gretly reduces. A solution for such problems is dividing the given rnge into n even number of sub-intervls, pply the 3-point rule on ech sub-intervl nd perform summtion over the results. To compute the numericl integrl of function f(x) from to b using the Composite-Simpson s method, the following procedure cn be dopted: Divide the rnge of integrtion into n sub-intervls, giving step size h = (b )/n. Mke sure tht n is even. The integrl cn be now evluted s b f(x)dx h f() + 2 3 (n 2)/2 k=1 n/2 f(x 2k ) + 4 f(x 2l 1 ) + f(b) (2.2) l=1 The interpolting function is polynomil of degree 2 which is essentilly prbol. This in fct motivtes n to be even. The bove method is implemented in the MATLAB function CSimp.

Description 5 2.3 Generlized Closed Newton-Cotes qudrture method This is generlized formul tht encompsses lot of other methods like Trpezoidl, Simpson s, Boole s rule etc for evluting the pproximte vlue of definite integrls. To compute the numericl integrl of function f(x) from to b using Newton-Cotes qudrture rule where the interpolting function is polynomil of degree m, the following procedure cn be dopted: The Closed Newton-Cotes rule of degree m cn be written s b f(x)dx m A i f(x i ) (2.3) i=0 where x i re the nodes nd A i re the corresponding coefficients. Without loss of generlity, polynomils x 0, x 1, x 2,...,x m cn be chosen s f(x) which will led to liner system of equtions in A i A 0 + A 1 + + A m = b A 0 x 0 + A 1 x 1 + + A m x m = (b 2 2 )/2. A 0 x m 0 + A 1x m 1 + + A mx m m = (b m+1 m+1 )/(m + 1) The coefficients when divided by the step size h = (b )/m provide the corresponding weights of the qudrture. Substituting b = +mh nd x i = +ih into the bove system of equtions nd simplifying further gives liner system of equtions in w i w 0 + w 1 + + w m = m w 1 + 2w 2 + + mw m = m 2 /2. w 1 + 2 m w 2 + + m m w m = m m+1 /(m + 1) This system cn be written in mtrix form VW = M. Here V is the trnspose of the Vndermonde mtrix, W is the vector of unknowns w i nd M is the vector of constnt terms. This system cn be solved for w i With the nodes nd weights in hnd, the qudrture vlues cn be clculted nlogous to the bove methods. This method hs been implemented s composite rule in the MATLAB function NC.

Description 6 The limittion of this generlized formul is, however, tht the integrtion points re to be eqully spced for ny degree. This is becuse polynomil interpoltion using high degree cuses oscilltion t the ends of the intervl (Runge s phenomenon). Also, the vndermonde mtrix is ill-conditioned. Though, for degree m 10 the system is firly stble. 2.4 Gussin Qudrture Until now, procedures contined eqully spced bscisss t which function evlutions tke plce. However, in Gussin qudrture, this is not true. There is freedom in the choice of nodes s well, consequently llowing to perform higher order qudrture with the sme number of function evlutions (compred to Newton-Cotes method). Regrdless of the type of method, the integrnd is desired to be smooth over the intervl which llows well-pproximted polynomil s well. But, in prctice the integrnd is seldom smooth. This issue is ddressed in Gussin qudrture using so-clled weighing function using which integrble singulrities re removed. Conventionlly, the domin of integrtion is tken s [-1,1]. The Gussin qudrture cn be represented s, 1 1 f(x)dx = 1 1 n 1 W (x)g(x)dx w i g(x i ) (2.4) Also, it hs been well estblished tht the nodes x i cn be evluted from the roots of n orthogonl polynomil. In this context, the inner product of two functions p(x) nd q(x) over weight function W (x) is defined s p, q = b i=0 W (x)p(x)q(x)dx (2.5) With this definition in mind, using the Grm-Schmidt process, set of orthogonl polynomils p j (x) cn be generted s, n 1 p n (x) := x n x n, p k p k, p k p k(x) (2.6) k=0 However, (2.6) is numericlly unstble. Hence, to construct the orthogonl polynomils for our purpose, the following theorem is used. Theorem 2.1. Monic orthogonl polynomils re given by the three term recurrence reltion, p 1 (x) 0 p 0 (x) 1 p n+1 (x) = (x n )p n (x) b n p n 1 (x)

Description 7 where (for,n 1) n := p n, xp n p n, p n b n := p n, p n p n 1, p n 1 (2.7) (2.8) Bsed on bove definitions, the nodes x i nd weights w i cn be computed from eigenvlue nlysis of the tridigonl Jcobi mtrix given by, 0 b1 b1 1 b2 J n =. b2........ n 2 bn 1 bn 1 n 1 (2.9) The nodes x i re nothing but the eigenvlues of the bove mtrix. Let V = V ij be the mtrix of eigen vectors. The weights re given by where S R is the domin of integrtion. w i = V1j 2 W (x)dx (2.10) S In the present work, Gussin qudrture bsed on the clssicl orthogonl polynomils hve been implemented. 2.4.1 Guss-Chebyshev qudrture This method uses the Chebyshev polynomils of the first kind. Using the recurrence reltion, they cn be written s, T 0 (x) = 1 T 1 (x) = x (2.11) T n+1 (x) = 2xT n (x) T n 1 (x) This method is used for evluting the pproximte vlue of the integrl of the kind: 1 1 f(x) 1 x 2 (2.12) where, the weighing function is 1/ 1 x 2

Description 8 The chebyshev nodes in the intervl (-1,1) re given by ( ) 2j 1 x j = cos 2n π, j = 1, 2,..., n (2.13) nd the weights re ll the sme nd equl to π/n The implementtion of this method cn be found in the MATLAB function GCheby 2.4.2 Guss-Hermite qudrture The Guss-Hermite qudrture is used to evlute the pproximte vlue of the integrl of the kind e x2 f(x)dx (2.14) where the weighing function is W (x) = e x2 This method uses the physicist s Hermite polynomils tht re given by, The recurrence reltion cn be written s, dn H n (x) = ( 1) n e x2 dx n e x2 (2.15) H n+1 (x) = 2xH n (x) 2nH n 1 (x) (2.16) Note tht, the leding coefficient of H n is 2 n. In order to mke the polynomil monic, it hs to be divided by the sme mount writing it in the form similr to Theorem 2.1, H n+1 (x) 2 n+1 = x H n(x) 2 n n H n 1 (x) 2 2 n 1 (2.17) p n+1 (x) = (x 0)p n (x) n 2 p n 1(x) (2.18) Hence, n = 0 nd b n = n/2. With these vlues, the tridigonl Jcobi mtrix cn be generted nd the nodes nd weights cn be computed s shown in (2.7) nd (2.8). The implementtion of this procedure cn be seen in the MATLAB function GHerm.

Description 9 2.4.3 Guss-Lguerre qudrture The Guss-Lguerre qudrture is used to evlute the pproximte vlue of the integrl of the kind where the weighing function is W (x) = e x This method uses the Lguerre polynomils defined by the formul, 0 e x f(x)dx (2.19) L n (x) = ex d n n! dx n (e x x n ) (2.20) The recurrence reltion cn be written s (n + 1)L n+1 (x) = (2n + 1 x)l n (x) nl n 1 (x) (2.21) The leding coefficient is gin not 1. Mking the relevnt chnges nd rewriting it in the form of Theorem 2.1, we get n = 2n + 1 nd b n = n 2. The corresponding Jcobi mtrix cn be constructed nd the nodes nd weights cn be computed from (2.7) nd (2.8). This method hs been implemented in the MATLAB function GLgu 2.4.4 Guss-Legendre qudrture The Guss-Legendre qudrture is the simplest form where the weighing function, W (x) = 1. The relted polynomils re clled Legendre polynomils. They my be written using the formul, P n (x) = 1 d n ( (x 2 2 n n! dx n 1) n) (2.22) The recurrence reltion cn be written s, (n + 1)P n+1 (x) = (2n + 1)xP n (x) np n 1 (x) (2.23) From (2.18) it is cler tht the leding coefficient is not 1. After rewriting the polynomils in monic form we get n = 0 nd b n = n 2 /(4n 2 1). The corresponding Jcobi mtrix cn be constructed nd the nodes nd weights cn be computed from (2.7) nd (2.8). This method hs been implemented in the MATLAB function GLege

Description 10 2.4.5 Guss-Lobtto qudrture This procedure is similr to Guss-Legendre with the key difference being, the intervl end points re lso considered s nodes. This leds to slight modifiction in the tridigonl Jcobi mtrix s shown below. 0 b1 b1 1 b2. b2..... J n =... n 2 bn 1 bn 1 n 1 bn bn n bn+1 bn+1 n+1 (2.24) Compred to (2.7), few extr terms cn be observed. Also, b n+1 = (n + 1)/(2n + 1) cn be obtined. The rest of the procedure is s explined bove. This method hs been implemented in the MATLAB function GLob