Integration Integration: is the total value, or summation, of f(x) dx over the range from a to b:

Slides:



Advertisements
Similar presentations
ES 240: Scientific and Engineering Computation. Chapter 17: Numerical IntegrationIntegration  Definition –Total area within a region –In mathematical.
Advertisements

1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Numerical Integration of Functions
NUMERICAL DIFFERENTIATION AND INTEGRATION
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Today’s class Romberg integration Gauss quadrature Numerical Methods
Numerical Integration
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
Numerical Integration Lecture (II)1
Newton-Cotes Integration Formula
Lecture 3: Integration. Integration of discrete functions
INTEGRALS 5. INTEGRALS We saw in Section 5.1 that a limit of the form arises when we compute an area.  We also saw that it arises when we try to find.
CHAPTER 4 THE DEFINITE INTEGRAL.
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 22 Integration of Equations.
Numerical Integration
Chapter 17 Objectives Recognizing that Newton-Cotes integration formulas are based on the strategy of replacing a complicated function or tabulated data.
Integration of Equations
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Numerical Differentiation and Integration Standing.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Numerical Differentiation and Integration ~ Newton-Cotes.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Numerical Integration Formulas
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
Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem.
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.
Engineering Analysis ENG 3420 Fall 2009
Lecture 28: Comparison of different numerical integrators 1.Adaptive Simpson’s and Trapezoid Rules 2. Romberg Integration 3. Adaptive Gaussian Quadrature.
1 NUMERICAL INTEGRATION Motivation: Most such integrals cannot be evaluated explicitly. Many others it is often faster to integrate them numerically rather.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Automatic Integration
Today’s class Numerical Integration Newton-Cotes Numerical Methods
3. Numerical integration (Numerical quadrature) .
MECN 3500 Inter - Bayamon Lecture Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.
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.
CMPS1371 Introduction to Computing for Engineers NUMERICAL METHODS.
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.
Wicomico High School Mrs. J. A. Austin AP Calculus 1 AB Third Marking Term.
MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)
 Finding area of polygonal regions can be accomplished using area formulas for rectangles and triangles.  Finding area bounded by a curve is more challenging.
Integration Copyright © Cengage Learning. All rights reserved.
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.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 22.
5.5 The Trapezoidal Rule. I. Trapezoidal Rule A.) Area of a Trapezoid -
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapter 21.
Numerical Integration
Time velocity After 4 seconds, the object has gone 12 feet. Consider an object moving at a constant rate of 3 ft/sec. Since rate. time = distance: If we.
Techniques for Numerical Integration
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 5 Integration and Differentiation.
Chapters 5 and 6: Numerical Integration Code development trapezoid rule Simpson’s rule Gauss quadrature Laguerre quadrature Analysis changing the variable.
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
Part 6 - Chapter 21.
Copyright © Cengage Learning. All rights reserved.
Numerical Integration Formulas
Chapter 22.
Integration with Unequal Segments
NUMERICAL DIFFERENTIATION AND INTEGRATION
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Numerical Computation and Optimization
Numerical Integration of Functions
SKTN 2393 Numerical Methods for Nuclear Engineers
Numerical Integration
Objectives Approximate a definite integral using the Trapezoidal Rule.
Numerical Integration
Presentation transcript:

Integration Integration: is the total value, or summation, of f(x) dx over the range from a to b:

Composite Trapezoidal Rule Assuming n+1 data points are evenly spaced, there will be n intervals over which to integrate. The total integral can be calculated by integrating each subinterval and then adding them together:

Simpson’s Rules More complicated approximation formulas can improve the accuracy for curves - these include using (a) 2nd and (b) 3rd order polynomials. The formulas that result from taking the integrals under these polynomials are called Simpson’s rules.

Simpson’s Rule Simpson’s rule corresponds to using second- order polynomials Integration over the three points simplifies to:

Composite Simpson’s Rule Simpson’s rule can be used on a set of subintervals in much the same way the trapezoidal rule was, except there must be an odd number of points. Because of the heavy weighting of the internal points, the formula is a little more complicated than for the trapezoidal rule:

Simpson’s 3/8 Rule Simpson’s 3/8 rule corresponds to using third-order polynomials to fit four points. Integration over the four points simplifies to: Simpson’s 3/8 rule is generally used in concert with Simpson’s 1/3 rule when the number of segments is odd.

Integration with Unequal Segments Previous formulas were simplified based on equispaced data points - though this is not always the case. The trapezoidal rule may be used with data containing unequal segments:

MATLAB Functions MATLAB has built-in functions to evaluate integrals based on the trapezoidal rule z = trapz(y) z = trapz(x, y) produces the integral of y with respect to x. If x is omitted, the program assumes h=1. z = cumtrapz(y) z = cumtrapz(x, y) produces the cumulative integral of y with respect to x. If x is omitted, the program assumes h=1.

Example Approximate the distance travelled from the following experimental data: Note, distance travelled is area under curve of velocity, ie integral t v

Gauss Quadrature Gauss quadrature describes a class of techniques for evaluating the area under a straight line by joining any two points on a curve rather than simply choosing the endpoints. The key is to choose the line that balances the positive and negative errors.

Gauss-Legendre Formulas The Gauss-Legendre formulas seem to optimize estimates to integrals for functions over intervals from -1 to 1. Integrals over other intervals require a change in variables to set the limits from -1 to 1. The integral estimates are of the form: where the c i and x i are calculated to ensure that the method exactly integrates up to (2n-1) th order polynomials over the interval from -1 to 1.

Adaptive Quadrature Methods such as Simpson’s 1/3 rule has a disadvantage in that it uses equally spaced points - if a function has regions of abrupt changes, small steps must be used over the entire domain to achieve a certain accuracy. Adaptive quadrature methods for integrating functions automatically adjust the step size so that small steps are taken in regions of sharp variations and larger steps are taken where the function changes gradually.

Adaptive Quadrature in MATLAB MATLAB has two built-in functions for implementing adaptive quadrature: –quad: uses adaptive Simpson quadrature –q = quad(fun, a, b, tol, trace, p1, p2, …) –fun : function to be integrated –a, b: integration bounds –tol: desired absolute tolerance (default: 10-6) –trace: flag to display details or not –p1, p2, …: extra parameters for fun –quadl has the same arguments