Chapter 4, Integration of Functions

Slides:



Advertisements
Similar presentations
M. Dumbser 1 / 18 Analisi Numerica Università degli Studi di Trento Dipartimento dIngegneria Civile ed Ambientale Dr.-Ing. Michael Dumbser Lecture on Numerical.
Advertisements

Numerical Integration
Computational Physics Numerical Integration Dr. Guy Tel-Zur Tulips by Anna Cervova, publicdomainpictures.net.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Computational Methods in Physics PHYS 3437
Section 5.7 Numerical Integration. Approximations for integrals: Riemann Sums, Trapezoidal Rule, Simpson's Rule Riemann Sum: Trapezoidal Rule: Simpson’s.
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
Chapter 7 Numerical Differentiation and Integration
Today’s class Romberg integration Gauss quadrature Numerical Methods
Numerical Integration
Computational Methods in Physics PHYS 3437
Chapter 3, Interpolation and Extrapolation. Interpolation & Extrapolation (x i,y i ) Find an analytic function f(x) that passes through given N points.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 30 Numerical Integration & Differentiation.
Lecture 3: Integration. Integration of discrete functions
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 29 Numerical Integration.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.
Numerical Integration
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 32.
2010/3/11 計算機在工程上的應用 Page 1 Gaussian quadrature Advisor: J. T. Chen Reporter: Jia-Wei Lee Date: Mar., 11, 2010.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
CISE301_Topic7KFUPM1 SE301: Numerical Methods Topic 7 Numerical Integration Lecture KFUPM Read Chapter 21, Section 1 Read Chapter 22, Sections 2-3.
CISE301_Topic71 SE301: Numerical Methods Topic 7 Numerical Integration Lecture KFUPM (Term 101) Section 04 Read Chapter 21, Section 1 Read Chapter.
Quadrature Greg Beckham. Quadrature Numerical Integration Goal is to obtain the integral with as few computations of the integrand as possible.
Chapter 4, Integration of Functions. Open and Closed Formulas x 1 =a x 2 x 3 x 4 x 5 =b Closed formula uses end points, e.g., Open formulas - use interior.
Chapter 4 Numerical Differentiation and Integration 1/16 Given x 0, approximate f ’(x 0 ). h xfhxf xf h )()( lim)('    x0x0 x1x1 h x1x1 x0x0.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
3. Numerical integration (Numerical quadrature) .
Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.
Numerical Computation
1 Chapter 7 NUMERICAL INTEGRATION. 2 PRELIMINARIES We use numerical integration when the function f(x) may not be integrable in closed form or even in.
1 Numerical Analysis Lecture 12 Numerical Integration Dr. Nader Okasha.
MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)
Lecture 22 - Exam 2 Review CVEN 302 July 29, 2002.
1. Interpolating polynomials Polynomial of degree n,, is a linear combination of Definitions: (interval, continuous function, abscissas, and polynomial)
6. Introduction to Spectral method. Finite difference method – approximate a function locally using lower order interpolating polynomials. Spectral method.
5. Integration 2.Quadrature as Box Counting 3.Algorithm: Trapezoid Rule 4.Algorithm: Simpson’s Rule 5.Integration Error 6.Algorithm: Gaussian Quadrature.
Chap. 11 Numerical Differentiation and Integration
CHAPTER 3 NUMERICAL METHODS
Lecture 22 Numerical Analysis. Chapter 5 Interpolation.
1/7  4.6 Adaptive Quadrature Methods Chapter 4 Numerical Differentiation and Integration -- Adaptive Quadrature Methods   /2  /4  /8 Predict the.
The purpose of Chapter 5 is to develop the basic principles of numerical integration Usefule Words integrate, integral 积分(的), integration 积分(法), quadrature.
SE301_Topic 6Al-Amer20051 SE301:Numerical Methods Topic 6 Numerical Integration Dr. Samir Al-Amer Term 053.
Runge Kutta schemes Taylor series method Numeric solutions of ordinary differential equations.
Quadrature – Concepts (numerical integration) Don Allen.
NUMERICAL ANALYSIS I. Introduction Numerical analysis is concerned with the process by which mathematical problems are solved by the operations.
Numerical Integration
CHAPTER 3 NUMERICAL METHODS
NUMERICAL DIFFERENTIATION Forward Difference Formula
Chapter 7 Numerical Differentiation and Integration
Numerical Analysis Lecture 25.
Chapter 3, Interpolation and Extrapolation
NUMERICAL DIFFERENTIATION AND INTEGRATION
Interpolation.
Chapter 9 Function Approximation
Numerical Analysis Lecture 45.
Class Notes 9: Power Series (1/3)
Chapter 7 Numerical Differentiation and Integration
NUMERICAL INTEGRATION
182A – Engineering Mathematics
Numerical Integration:
MATH 174: Numerical Analysis
SKTN 2393 Numerical Methods for Nuclear Engineers
Numerical Analysis Lecture 24.
Numerical Integration
Approximation of Functions
Chapter 4, Integration of Functions
Approximation of Functions
Chapter 3, Interpolation and Extrapolation
Presentation transcript:

Chapter 4, Integration of Functions

Open and Closed Formulas Open formulas - use interior points only. Extended formulas – piecewise sum of integration formula. x1=a x2 x3 x4 x5=b Closed formula uses end points, e.g.,

Deriving Integration Formulas Given N function values fi, i=1,2,…N, at xi, interpolate with the N−1 degree polynomial, and integrate the polynomial analytically. Assuming a form Σwifi, determine the weights wj by requiring that all polynomials of degree N−1 or less integrate exactly.

Closed Newton-Cotes Formulas Equally spaced abscissas, xj=x1+(j-1)h Lagrange’s interpolation formula Integrating, gives Where lj(x) is a polynomial of degree N-1 such that lj(xj) = 1 and lj(xk) = 0 if k ≠ j. Why error is O(hN+1)?

Special Cases, N=2,3,4 : the Integration Rules linear interpolation Trapezoidal rule Simpson’s rule 3/8 rule parabola Trapezoidal [trœpizəidl]. Simpson’rule rule is also called Kepler’s rule.

How to Estimate the Error Taylor expand the function f(x) around relevant points, e.g. for Trapezoidal rule: Integrate both expressions, add the result and divide by two, we get the trapezoidal rule with error. Why no O(h^2) term?

Open Formula in a Single Interval These formulas are useful to construct extended formulas with open interval Open formulas are useful for integrals where the end-point is singular, e.g.,

Extended Formulas x1 x2 x3 x4 … xN Using trapezoidal rule in intervals [x1,x2], [x2,x3], [x3,x4], …, and [xN-1,xN ], we get Using Simpson’s rule in intervals [x1,x3], [x3,x5], etc, we get

Trapezoidal Routine Sequence of points for each iteration n n = 1 Subdivide the intervals and compute fi only at points that have not computed before.

Recursive Computation of Trapezoidal Sum If n = 1 (two points, one interval) else if (n > 1)

trapzd( )

Romberg Integration Compute trapezoidal sum for different values of h, e.g., h0, h0/2, h0/4, h0/8, etc. Extrapolate T(h) in polynomial of h2 to h → 0. The justification for this is due to the Euler-Maclaurin formula.

Euler-Maclaurin Summation Formula B is called Bernoulli number. The important point is that T(h) is in powers of h2.

qromb( )

Theory of Gaussian Quadrature Find the best wj and xj [integrate exactly for all polynomials f(x) up to degree 2N-1]: where the weight function W(x) is assumed positive and continuous. Note that the right-hand side of the formula does no the weight function W(x).

Orthogonal Polynomials Two polynomials are said orthogonal with respect to a fixed weight function W(x) and fixed interval [a,b], if is zero. One can construct orthogonal polynomial set {pj(x), j=0,1, 2, …}. Index j indicate the degree of polynomial.

Example of Orthogonal Polynomials With weight W(x) = 1 in interval [-1,1], the corresponding orthogonal polynomials are the Legendre polynomials:

Constructing Orthogonal Polynomials Start with the first one, P0(x)=1 Let P1(x)=c0+c1x, determine the coefficients by requiring <P0|P1>=0, For weight W(x)=1 in interval [-1,1], this gives P1(x)=x Determine P2(x)= c0+c1x+c2x2 by requiring <P0|P2>=0, <P1|P2>=0 In general Pj+1(x) = (x-aj) Pj(x) – bj Pj-1(x) This process is known as Gram-Schmidt orthogonalization (in linear vector spaces). Why Pj+1 does not depends on Pj-2 and small index P?

Abscissas in Gaussian Quadrature For an N-point integration formula, choose the root of N-th orthogonal polynomial xj as the abscissas. Choose wj to satisfy It turns out that the ‘integration equal to 0’ is true also for i up to 2N-1.

Gaussian integration formula is exact for all polynomials of degree 2N-1 Let f(x) be any polynomial of degree 2N-1, we can write f(x) = q(x) PN(x) + r(x) where r(x) and q(x) are degree N-1. Considering the left- and right-hand side of the integration formula with function f(x), show that they are equal.

Solution for the Weight wj NR refers to “Numerical Recipes in C”, 2nd edition. This formula assumes that the polynomials are normalized according to Eqs.(4.5.6) & (4.57), page 149 of NR.

Reading, References Read Chapter 4 of NR. For an in-depth treatment of numerical methods, see, e.g., J. Stoer and R. Bulirsch, “Introduction to Numerical Analysis”. See also M. T. Heath, “Scientific Computing, an introductory survey”.

Problems for Lecture 4 1. Prove the Euler-Maclaurin summation formula for the first three terms, i.e., where h = (xN-x1)/(N-1). (Hint: Taylor expansion.) 2. Use the theory of Gaussian quadrature to find a 3-point integration formula for the weight W(x) = 1 and interval [0, 1]. That is, find the abscissas xj and weights wj such that the formula below is exact for all polynomials of degree 5 or less.