1 / 30

NUMERICAL METHODS OF INTEGRATION

NUMERICAL METHODS OF INTEGRATION . Finding the area under curves:. There are many mathematical applications which require finding the area under a curve. The area “under” a curve is defined as the area between the curve and the x -axis. This area can be:

chesna
Download Presentation

NUMERICAL METHODS OF INTEGRATION

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NUMERICAL METHODS OF INTEGRATION D MANCHE 2013

  2. Finding the area under curves: • There are many mathematical applications which require finding the area under a curve. • The area “under” a curve is defined as the area between the curve and the x-axis. • This area can be: • estimated by using “numerical methods” or • calculated using “calculus methods”.

  3. Example to consider: Find the area under the curve between and

  4. Exact area: It can be shown, using calculus, that the exact area under the curve as shown is 12 square units. (We will see how later.)

  5. Numerical Methods v Calculus: • We will consider several numerical methods which can be used to give a good approximation of the area under a curve. • Calculus, specifically definite integrals, can be used to find the exact area under a curve. We will consider this method later.

  6. Numerical Methods of Integration While definite integrals lead to the exact area under the curve, numerical methods of integration give an approximation of this area. These numerical methods for finding area under a curve are particularly useful - • if the function is not known • if the function cannot be integrated algebraically • if the function is difficult to integrate algebraically.

  7. Numerical methods: • Rectangle Method • Midpoint Method • Trapezoidal Method • Simpson’s Rule • Monte Carlo Method

  8. Rectangle Method • The interval from x=a to x=b is first divided into n intervals. • Each interval has a width of To keep this example simple, n = 3. x0 x1 x2 x3 a b • Since there are n intervals there will be n +1 x-values. • The first one is x0 =a and the last one is xn = b.

  9. Rectangle Method (cont.) • n rectangles are then drawn. • The width is the same for each rectangle and the height is given by the appropriate f(x) value. • The area of each rectangle is found in the usual way (Area = width x height). • The sum of the areas of these rectangles approximates the area under the curve. • These rectangles can be constructed in several ways.

  10. Rectangle Method Upper rectangles Lower rectangles Left rectangles Right rectangles

  11. Rectangle Method (cont.) Calculations using Left Rectangles Shaded area [The exact area is actually 12 square units. So, in this instance, the rectangle method underestimates the area under the curve.]

  12. Rectangle method (cont.) • The Rectangle method is the simplest method to use, but it is usually the most inaccurate. • Its accuracy can be improved by increasing the number of intervals (n). As n gets larger, the closer the approximation gets to the real area under the curve. n=3 n=6 n=12 n=30

  13. Midpoint Method • All of the rectangle methods use f(x0), f(x1), f(x2) or f(x3) as the height of the rectangles, ie. the heights already drawn in the first graph below. • The midpoint method locates the midpoint of each interval eg (x0+x1)/2, and uses the height f [(x0 +x1)/2] as the height of the rectangle. • The area of this rectangle is generally a better approximation than that obtained by using either the left or right rectangles or upper or lower rectangles. • The process is continued for the remaining intervals and areas added. Midpoint of interval

  14. Try the midpoint method for yourself:

  15. Midpoint Method (cont.) Shaded area Note that this is a better approximation than that obtained using the rectangle method.

  16. Trapezoidal Method Instead of using rectangles, the trapezoidal method (not surprisingly) uses trapeziums to approximate the area under the curve. The trapeziums are formed by joining the points on the curve with straight lines. Compared to the rectangle method, the trapezoidal method gives a better approximation for the real area, as obvious in the graph below.

  17. Trapezoidal Method (cont.) Recall that the area of a trapezium with parallel sides of length a and b and with perpendicular height h is given by: Area a h b Area = average of parallel sides x perpendicular distance between them

  18. Trapezoidal Method (cont.) Shaded area Note that all of the terms, except the first and last, appear twice in this expression. where w = width of each strip E = sum of end ordinates M = sum of middle ordinates a=x0 x1 x2 x3=b

  19. Trapezoidal Method (cont.) Area  Area [Remember that the real area under the curve is 12 square units.] a=x0 x1 x2 x3=b

  20. Trapezoidal Method (cont.) • The Trapezoidal Method is an improvement over the Rectangle Method because the points at the top of each strip are joined by an oblique line rather than a horizontal line from either the left or the right. This leads to a better approximation of the area under the curve. Trapezoidal Method Rectangle Method (left)

  21. Simpson’s Rule • Simpson’s Rule improves on the Trapezoidal method by placing a parabola (red) rather than an oblique line (green) between points on the curve (blue). • Simpson’s rule considers 2 strips at a time so n must be even.

  22. Simpson’s Rule (cont.) Area The proof for Simpson’s rule is beyond the scope of this course, but if interested see http://pages.pacificcoast.net/~cazelais/187/simpson.pdf

  23. Simpson’s Rule (cont.) Simpson’s Rule requires an even number of intervals, so in this example we will use n=6.

  24. Simpson’s Rule (cont.) Area Because the function here is that of a parabola, Simpson’s Rule gives the exact area. This will not be the case when the function is not a quadratic.  Area

  25. Monte Carlo Method The Monte Carlo method involves determining the proportion of the area of a suitably positioned rectangle that includes the area that lies under a given curve (see diagram below). Area of rectangle = 21 sq units 7 3

  26. Monte Carlo Method (cont.) By positioning a series of randomly chosen points inside this rectangle and counting the number of these points that fall on or inside the required area, this proportion can be determined. Then the required area (shaded) can be found by multiplying this proportion by the area of the rectangle. 12 points out of 20

  27. Monte Carlo Method (cont.) So in this case: • 12 out of 20 points fell in the shaded area • The area of the rectangle was 21 square units Therefore: Area ≈ (12/20) x 21 = 12.6 square units Generally, the more random points chosen, the better the approximation.

  28. Summary of Numerical Integration Methods • used to find an approximation for the area under a curve • used when the function is unknown or cannot be integrated • Rectangle, Midpoint, Trapezoidal methods and Simpson’s rule generally improve as the number of intervals increases • Monte Carlo Method generally improves as number of random points increases • because repetitive calculations are involved, these methods lend themselves well to spreadsheets

  29. Using Calculus to find area: Since the area lies above the x-axis :

  30. So the exact area under the curve is 12 square units.

More Related