Integration COS 323. Numerical Integration Problems Basic 1D numerical integration:Basic 1D numerical integration: – Given ability to evaluate f (x) for.

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

PROGRAM 8 consider a function y = f(x). In order to evaluate definite integral I = a ∫ b y dx = a ∫ b f(x) dx Divide the interval (b-a) of x into n equal.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Computational Methods in Physics PHYS 3437
Computational Methods in Physics PHYS 3437
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
NUMERICAL DIFFERENTIATION AND INTEGRATION
Chapter 7 Numerical Differentiation and Integration
Today’s class Romberg integration Gauss quadrature Numerical Methods
Lecture 18 - Numerical Differentiation
Numerical Integration
Numerical Integration Lecture (II)1
Newton-Cotes Integration Formula
Lecture 3: Integration. Integration of discrete functions
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Part 6 Calculus.
19.5 Numeric Integration and Differentiation
Simpson’s 1/3 rd Rule of Integration. What is Integration? Integration The process of measuring the area under a.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 21 Newton-Cotes Integration Formula.
Numerical Integration In general, a numerical integration is the approximation of a definite integration by a “weighted” sum of function values at discretized.
Integrals 5.
Automatic Integration
Today’s class Numerical Integration Newton-Cotes Numerical Methods
3. Numerical integration (Numerical quadrature) .
Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.
Techniques of Integration
MAT 1235 Calculus II Section 7.7 Approximate (Numerical) Integration
Ch 8.3: The Runge-Kutta Method
1 Simpson’s 1/3 rd Rule of Integration. 2 What is Integration? Integration The process of measuring the area under a curve. Where: f(x) is the integrand.
Lecture 19 – Numerical Integration 1 Area under curve led to Riemann sum which led to FTC. But not every function has a closed-form antiderivative.
Chapters 5 and 6: Numerical Integration
4.6 Numerical Integration Trapezoid and Simpson’s Rules.
CSE 330 : Numerical Methods
Integration Copyright © Cengage Learning. All rights reserved.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Integration.
5.1.  When we use the midpoint rule or trapezoid rule we can actually calculate the maximum error in the calculation to get an idea how much we are off.
Techniques of Integration Substitution Rule Integration by Parts Trigonometric Integrals Trigonometric Substitution Integration of Rational Functions by.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 22.
In this section, we will investigate how to estimate the value of a definite integral when geometry fails us. We will also construct the formal definition.
Section 5.9 Approximate Integration Practice HW from Stewart Textbook (not to hand in) p. 421 # 3 – 15 odd.
Chap. 11 Numerical Differentiation and Integration
Numerical Methods Solution of Equation.
Today’s class Ordinary Differential Equations Runge-Kutta Methods
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 5 Integration and Differentiation.
Clicker Question 1 What is ? (Hint: u-sub) – A. ln(x – 2) + C – B. x – x 2 + C – C. x + ln(x – 2) + C – D. x + 2 ln(x – 2) + C – E. 1 / (x – 2) 2 + C.
Numerical Integration using Trapezoidal Rule
Quadrature – Concepts (numerical integration) Don Allen.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 20 Numerical Integration of Functions.
NUMERICAL DIFFERENTIATION Forward Difference Formula
Lecture 19 – Numerical Integration
Part 6 - Chapter 21.
Chapter 7 Numerical Differentiation and Integration
Approximate Integration
Clicker Question 1 What is ? A. x tan(x2) + C
Midpoint and Trapezoidal Rules
NUMERICAL INTEGRATION
Numerical Analysis Lecture 42.
Chapter 22.
NUMERICAL DIFFERENTIATION AND INTEGRATION
The Normal Distribution…
Chapter 23.
Chapter 7 Numerical Differentiation and Integration
Composite Numerical Integration
Summation Formulas Constant Series.
SKTN 2393 Numerical Methods for Nuclear Engineers
Arc Length … x y a b xi ... Pi P0 P1 Pn
Numerical Integration
Presentation transcript:

Integration COS 323

Numerical Integration Problems Basic 1D numerical integration:Basic 1D numerical integration: – Given ability to evaluate f (x) for any x, find – Goal: best accuracy with fewest samples Other problems (future lectures):Other problems (future lectures): – Improper integration – Multi-dimensional integration – Ordinary differential equations – Partial differential equations

Trapezoidal Rule Approximate function by trapezoidApproximate function by trapezoid ab f(a) f(b)

Trapezoidal Rule ab f(a)f(b)

Extended Trapezoidal Rule ab f(a)f(b) Divide into segments of width h : ab

Trapezoidal Rule Error Analysis How accurate is this approximation?How accurate is this approximation? Start with Taylor series for f (x) around aStart with Taylor series for f (x) around a

Trapezoidal Rule Error Analysis Expand LHS:Expand LHS: Expand RHSExpand RHS

Trapezoidal Rule Error Analysis So,So, In general, error for a single segment proportional to h 3In general, error for a single segment proportional to h 3 Error for subdividing entire a  b interval proportional to h 2Error for subdividing entire a  b interval proportional to h 2 – “Cubic local accuracy, quadratic global accuracy”

Determining Step Size Change in integral when reducing step size is a reasonable guess for accuracyChange in integral when reducing step size is a reasonable guess for accuracy For trapezoidal rule, easy to go from h  h/2 without wasting previous samplesFor trapezoidal rule, easy to go from h  h/2 without wasting previous samples ab

Approximate integral by parabola through three pointsApproximate integral by parabola through three points Better accuracy for same # of evaluationsBetter accuracy for same # of evaluations Simpson’s Rule ab f(a) f(b)

Richardson Extrapolation Better way of getting higher accuracy for a given # of samplesBetter way of getting higher accuracy for a given # of samples Suppose we’ve evaluated integral for step size h and step size h/2:Suppose we’ve evaluated integral for step size h and step size h/2: ThenThen

Richardson Extrapolation This treats the approximation as a function of h and “extrapolates” the result to h=0This treats the approximation as a function of h and “extrapolates” the result to h=0 Can repeat:Can repeat: –1/3 4/3 –1/15 16/15 –1/63 64/63

Open Methods Trapezoidal rule won’t work if function undefined at one of the points where evaluatingTrapezoidal rule won’t work if function undefined at one of the points where evaluating – Most often: function infinite at one endpoint Open methods only evaluate function on the open interval (i.e., not at endpoints)Open methods only evaluate function on the open interval (i.e., not at endpoints)

Midpoint Rule Approximate function by rectangle evaluated at midpointApproximate function by rectangle evaluated at midpoint ab

Extended Midpoint Rule Divide into segments of width h : ab ab

Midpoint Rule Error Analysis Following similar analysis to trapezoidal rule, find that local accuracy is cubic, quadratic global accuracyFollowing similar analysis to trapezoidal rule, find that local accuracy is cubic, quadratic global accuracy Formula suitable for adaptive method, Richardson extrapolation, but can’t halve intervals without wasting samplesFormula suitable for adaptive method, Richardson extrapolation, but can’t halve intervals without wasting samples

Discontinuities All the above error analyses assumed nice (continuous, differentiable) functionsAll the above error analyses assumed nice (continuous, differentiable) functions In the presence of a discontinuity, all methods revert to accuracy proportional to hIn the presence of a discontinuity, all methods revert to accuracy proportional to h Locally-adaptive methods: do not subdivide all intervals equally, focus on those with large error (estimated from change with a single subdivision)Locally-adaptive methods: do not subdivide all intervals equally, focus on those with large error (estimated from change with a single subdivision)