Numerical Integration UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.

Slides:



Advertisements
Similar presentations
A Riemann sum is a method for approximating the total area underneath a curve on a graph. This method is also known as taking an integral. There are 3.
Advertisements

CHAPTER 4 THE DEFINITE INTEGRAL.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Prentice Hall Slide 5- 1.
8 TECHNIQUES OF INTEGRATION. There are two situations in which it is impossible to find the exact value of a definite integral. TECHNIQUES OF INTEGRATION.
Solving ODEs UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
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.
Simpson’s 1/3 rd Rule of Integration. What is Integration? Integration The process of measuring the area under a.
Automatic Integration
MAT 1235 Calculus II Section 7.7 Approximate (Numerical) Integration
INTRODUCTORY MATHEMATICAL ANALYSIS For Business, Economics, and the Life and Social Sciences  2011 Pearson Education, Inc. Chapter 14 Integration.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Prentice Hall 5.4 Fundamental Theorem of Calculus.
4.6 Numerical Integration -Trapezoidal Rule -Simpson’s Rule
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.
Chapters 5 and 6: Numerical Integration
4.6 Numerical Integration Trapezoid and Simpson’s Rules.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Prentice Hall Slide 5- 1.
Solving Linear Equations UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the.
 Finding area of polygonal regions can be accomplished using area formulas for rectangles and triangles.  Finding area bounded by a curve is more challenging.
Regression UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
6.3 Definite Integrals and the Fundamental Theorem.
5.c – The Fundamental Theorem of Calculus and Definite Integrals.
Homework questions thus far??? Section 4.10? 5.1? 5.2?
Section 5.4a FUNDAMENTAL THEOREM OF CALCULUS. Deriving the Theorem Let Apply the definition of the derivative: Rule for Integrals!
7.4: The Fundamental Theorem of Calculus Objectives: To use the FTC to evaluate definite integrals To calculate total area under a curve using FTC and.
EE3561_Unit 7Al-Dhaifallah EE 3561 : Computational Methods Unit 7 Numerical Integration Dr. Mujahed AlDhaifallah ( Term 342)
Integration Copyright © Cengage Learning. All rights reserved.
Chapter 4 Integration.
CHAPTER 4 SECTION 4.4 THE FUNDAMENTAL THEOREM OF CALCULUS.
Section 4.4 The Fundamental Theorem of Calculus Part II – The Second Fundamental Theorem.
4.4 The Fundamental Theorem of Calculus
Chapter 5-The Integral Calculus, 2ed, by Blank & Krantz, Copyright 2011 by John Wiley & Sons, Inc, All Rights Reserved.
F UNDAMENTAL T HEOREM OF CALCULUS 4-B. Fundamental Theorem of Calculus If f(x) is continuous at every point [a, b] And F(x) is the antiderivative of f(x)
Mathematics. Session Definite Integrals –1 Session Objectives  Fundamental Theorem of Integral Calculus  Evaluation of Definite Integrals by Substitution.
Script Files UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Integration For a function f, The “integral of f from a to b” is the area under the graph of the function. If f is continuous, then the area is well defined,
Numerical Differentiation and Quadrature (Integration)
Numerical Differentiation UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under.
IEEE Arithmetic UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Section 5.9 Approximate Integration Practice HW from Stewart Textbook (not to hand in) p. 421 # 3 – 15 odd.
Searching UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Antidifferentiation: The Indefinite Intergral Chapter Five.
Chapter 5 – The Definite Integral. 5.1 Estimating with Finite Sums Example Finding Distance Traveled when Velocity Varies.
Polynomials UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons.
Basics of Matlab UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
Techniques for Numerical Integration
Warm up Problems More With Integrals It can be helpful to guess and adjust Ex.
Root Finding UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative.
SE301_Topic 6Al-Amer20051 SE301:Numerical Methods Topic 6 Numerical Integration Dr. Samir Al-Amer Term 053.
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.
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc. Integration 5 Antiderivatives Substitution Area Definite Integrals Applications.
Essential Question: How is a definite integral related to area ?
The Fundamental Theorem of Calculus Area and The Definite Integral OBJECTIVES  Evaluate a definite integral.  Find the area under a curve over a given.
Calculus 4-R Unit 4 Integration Review Problems. Evaluate 6 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 20 Numerical Integration of Functions.
Numerical Integration
Air Force Admin College, Coimbatore
Clicker Question 1 What is ? A. x tan(x2) + C
Copyright © Cengage Learning. All rights reserved.
For/Switch/While/Try UC Berkeley Fall 2004, E77 me
Copyright (c) 2003 Brooks/Cole, a division of Thomson Learning, Inc.
6-4 Day 1 Fundamental Theorem of Calculus
Integration Review Problems
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Function Handles UC Berkeley Fall 2004, E Copyright 2005, Andy Packard
Simpson’s 1/3rd Rule of Integration
Numerical Integration
Objectives Approximate a definite integral using the Trapezoidal Rule.
Air Force Admin College, Coimbatore
Presentation transcript:

Numerical Integration UC Berkeley Fall 2004, E77 Copyright 2005, Andy Packard. This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Integration For a function f, The “integral of f from a to b” is the area under the graph of the function. If f is continuous, then the area is well defined, as the common limit of upper and lower sums. The integral is denoted a b x graph of f(x)

Integration: Fundamental theorem of Calculus If a function g is the antiderivative of f, namely for all x, then the fundamental theorem of calculus gives that the integral of f can be computed by evaluating g But finding antiderivatives can be hard… In many cases of engineering and scientific (and economics, etc) interest –the functions do not have known antiderivatives, so… –the integral (area) must be approximated by a finite number of function evaluations.

Numerical Integration: Trapezoid a b x graph of f(x) a b x approximate this region with this trapezoid

Composite Trapezoid a b x graph of f(x) Apply “ trapezoid ” approximation to k subdivisions of [a b] a b x graph of f(x) “ trapezoid ” approximation with 3 subdivisions of [a b]

Composite Trapezoid a b x graph of f(x) “ trapezoid ” approximation with 3 subdivisions of [a b] h Let h=(b-a)/3. The sum of all the approximations is

Derivation of Simpson’s Rule: Suppose f(x)=x 3

Simpson’s Rule: Suppose f(x)=x 2

Simpson’s Rule: Suppose f(x)=x

Simpson’s Rule: Suppose f(x)=1

Simpson’s Rule: Derivation Put all of those together, along with Hence: If f is any cubic polynomial, then This is the basis for Simpson ’ s rule.

Simpson’s Rule For any function f, the Simpson ’ s approximation to is Evaluate the function at the endpoints and in the middle

Composite Simpson’s Rule a b x graph of f(x) Simpson on 3 subdivisions of [a b] h h=(b-a)/3 Add them up. Total of 7 function evaluations.

Composite Simpson’s Rule a b x graph of f(x) Simpson on 2 subdivisions of [a b] h=(b-a)/2 5 function evaluations giving the approximation as I S =I 1 S +I 2 S

Numerical Integration: Ad-Hoc stopping criteria Pick a method (trapezoid, or Simpson’s). Set a stopping tolerance TOL. Pick k, an initial number of subdivisions Iterate as below –Apply composite method using k divisions –Apply composite method using 2k divisions –If answers are within TOL, stop, and return the 2k division answer –If answers are not within TOL, increase k and repeat. With only this much analysis, the computed answer is not specifically known to be accurate to any specific precision.

Adaptive Stepsize Only use small h (the “stepsize”) where the convergence demands it. Recursive implementation is straightforward. function I = adr(fh,a,b,tol) Compute I1 using 1 subdivision Compute I2 using 2 subdivisions If the answers are within tol, I = I2; Else m = (a+b)/2; ILeft = adr(fh,a,m,tol/2); IRight = adr(fh,m,b,tol/2); I = ILeft + IRight; end

Error Analysis More error analysis can be done making assumptions about the magnitude of the derivatives of f –A bound on the magnitude of 3 rd derivative of f yields accuracy bounds for the Trapezoid method –A bound on the magnitude of 5 th derivative of f yields accuracy bounds for the Simpson’s method Learn more about these in Math 128A

Matlab functions trapz –fixed trapezoidal approximation –data is vectors x and y ( y represents f(x) ) –1 division between each data pair quad –Adaptive Simpson’s method –Data is function handle, interval endpoints, stopping tolerance