Lecture 3: Integration. Integration of discrete functions

Slides:



Advertisements
Similar presentations
6. 4 Integration with tables and computer algebra systems 6
Advertisements

Numerical Integration
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Mathematics1 Mathematics 1 Applied Informatics Štefan BEREŽNÝ.
NUMERICAL DIFFERENTIATION AND INTEGRATION
Chapter 7 Numerical Differentiation and Integration
Today’s class Romberg integration Gauss quadrature Numerical Methods
Numerical Integration
EARS1160 – Numerical Methods notes by G. Houseman
Lecture 2: Numerical Differentiation. Derivative as a gradient
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De.
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.
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.
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.
Quadrature Greg Beckham. Quadrature Numerical Integration Goal is to obtain the integral with as few computations of the integrand as possible.
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.
Integrals 5.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Today’s class Numerical Integration Newton-Cotes Numerical Methods
3. Numerical integration (Numerical quadrature) .
Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.
Numerical Computation
MAT 1235 Calculus II Section 7.7 Approximate (Numerical) Integration
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.
Integration. Indefinite Integral Suppose we know that a graph has gradient –2, what is the equation of the graph? There are many possible equations for.
D MANCHE Finding the area under curves:  There are many mathematical applications which require finding the area under a curve.  The area “under”
Chapters 5 and 6: Numerical Integration
4.6 Numerical Integration Trapezoid and Simpson’s Rules.
 Finding area of polygonal regions can be accomplished using area formulas for rectangles and triangles.  Finding area bounded by a curve is more challenging.
Area/Sigma Notation Objective: To define area for plane regions with curvilinear boundaries. To use Sigma Notation to find areas.
EE3561_Unit 7Al-Dhaifallah EE 3561 : Computational Methods Unit 7 Numerical Integration Dr. Mujahed AlDhaifallah ( Term 342)
Integration Copyright © Cengage Learning. All rights reserved.
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 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.
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 the distance traveled.
5 INTEGRALS.
5.5 Numerical Integration. concave down concave up concave down concave up concave down.
Warm up HW Assessment You may use your notes/ class work / homework.
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.
Area/Sigma Notation Objective: To define area for plane regions with curvilinear boundaries. To use Sigma Notation to find areas.
Copyright © Cengage Learning. All rights reserved. 7 Techniques of Integration.
Approximating Antiderivatives. Can we integrate all continuous functions? Most of the functions that we have been dealing with are what are called elementary.
Numerical Integration using Trapezoidal Rule
Numerical Integration
NUMERICAL DIFFERENTIATION Forward Difference Formula
5.5 The Trapezoid Rule.
Chapter 7 Numerical Differentiation and Integration
Clicker Question 1 What is ? A. x tan(x2) + C
Numerical Analysis Lecture 42.
Numerical Integration Formulas
The Area Question and the Integral
TECHNIQUES OF INTEGRATION
Copyright © Cengage Learning. All rights reserved.
Using integrals to find area works extremely well as long as we can find the antiderivative of the function. Sometimes, the function is too complicated.
Summation Formulas Constant Series.
Copyright © Cengage Learning. All rights reserved.
Warm-up 2/4 Find the AVERAGE VALUE of
SKTN 2393 Numerical Methods for Nuclear Engineers
Arc Length … x y a b xi ... Pi P0 P1 Pn
Numerical Integration
Objectives Approximate a definite integral using the Trapezoidal Rule.
Comp 208 Computers in Engineering Yi Lin Winter, 2007
Presentation transcript:

Numerical Methods notes by G. Houseman for EARS1160, ENVI2240, CCFD1160 Lecture 3: Integration. Integration of discrete functions Interpretation of an integral Taylor's series (again!) Mid-point rule Trapezoid rule Romberg's method Simpson's rule

Integration of Discrete Functions Given a function f(x), which could be represented by the discrete function {f(xi)} at the set of sample points {xi}, how do we evaluate the definite integral ? and the indefinite integral ? In the case of a definite integral, the answer is a number and the main question is how to estimate it accurately. For the indefinite integral we are generating a new discrete function, constructed from the function f(x), but each entry of the new function Fj = F(xj) is just a definite integral, with upper limit at point xj.

Interpretation of an integral The definite integral is interpreted as the area between x = a and x = b, between the lines y = 0 and y = f(x). We can approximate the area by summing up the areas of the set of thin vertical strips between x = xj and x = xj+1. x f(x) Dx a b

Taylor's series (again!) The function f(x) in the range is approximated by the Taylor's series about the midpoint xm of the range. Then the integral is computed as the sum of the separate integrals of the terms: Note that the second (and fourth, sixth, etc) term is zero!

Mid-point rule Then provides an estimate of (i) the integral (the first term) and (ii) the error of the estimate (the second term). The error is proportional to (b-a)3 and to the curvature of the function at the midpoint. If we divide the interval into two segments, there will be two error components, but each is reduced in magnitude by a factor of 8 roughly, so the total error decreases by a factor of 4. If we divide the interval into N segments, the discretisation error is reduced by the factor N2. If we use too many segments however, the factor (b-a) becomes very small and round-off error may become large.

Trapezoid Rule If we are using a discrete function, our function is only defined at the points {xj}, j = 1, N, so using midpoints may be inconvenient. We can simply estimate in the mid-point rule, so that only the values at the end points of the interval (or of the sub-intervals) are needed. The error associated with this approximation is obtained from the Taylor's series at x = a and x = b, from which and then

Implementation of the Trapezoid rule The trapezoid rule is simply implemented as a summation of all the segment areas. If the N segment intervals of a discrete function are of equal length Dx, there are 2 end points and N-1 interior points some computational efficiency is gained: Each interior point is added twice, at the right end of one segment and at the left end of the adjacent segment, so the factor of 1/2 cancels at every summation point, except at the two end points.

Romberg's Method: 1 We saw that the error associated with the trapezoid method for a single interval is: If we subdivide the interval into N segments, we see that the error per segment decreases as N -3, and therefore the total error decreases as N -2 (approximate because f"(x) is variable through the interval, and often unknown). Assume that: where K depends on the curvature. Doubling the number of mesh intervals causes the segment length to be halved, so

Romberg's Method: 2 We saw that the error associated with the trapezoid method for a single interval is: From the estimate for N segments and that for 2N segments: and thus we obtain an estimate for the value of the integral that is significantly better than the 2N estimate: but still only approximate because of arbitrary variation of the second derivatives.

Simpson's rule Accuracy of the trapezium method is limited by loss of information about the curvature of the function in between sample points. If we use more points, in order to define the curvature, more accuracy is possible. If we use three regularly spaced points in the discrete function, we can fit a parabola exactly to those points, and the integral of this best-fit parabola is then In principle, this method is 4th order accurate, i.e. the error on each segment integration decreases as N -5. Since there are N segments, the total error therefore decreases as N -4. Exercise: show that the above formula is obtained if you fit a parabola to the 3 points at a, b, and (a+b)/2, and then integrate that parabola.

Simpson's Rule Another way of looking at this is that if we add twice the midpoint rule to the trapezoid rule we see that the leading terms in the error cancel, and we are left with Simpson's rule: Exercise: show that the magnitude of the error term is as given here.

Implementing Simpson's Rule Since Simpson's rule requires 3 point estimates for each segment, we take the interval segments of a discrete function two at a time (requires an even number N of segments): Odd numbered points here contribute to the integral with a weight of 4, compared to even points which contribute with a weight of 2 (1 from each neighbouring segment). This formula can give accurate results for the definite integral if the function is well behaved, but its application in the computation of the indefinite integral is not straightforward because of the requirement that segments be taken 2 at a time.