Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.

Similar presentations


Presentation on theme: "Lecture 19 - Numerical Integration CVEN 302 July 22, 2002."— Presentation transcript:

1

2 Lecture 19 - Numerical Integration CVEN 302 July 22, 2002

3 Lecture’s Goals Trapezoidal Rule Simpson’s Rule –1/3 Rule –3/8 Rule Midpoint Gaussian Quadrature Basic Numerical Integration

4 We want to find integration of functions of various forms of the equation known as the Newton Cotes integration formulas.

5 Basic Numerical Integration Weighted sum of function values x0x0 x1x1 xnxn x n-1 x f(x)

6 Numerical Integration Idea is to do integral in small parts, like the way you first learned integration - a summation Numerical methods just try to make it faster and more accurate

7 Numerical Integration Newton-Cotes Closed Formulae -- Use both end points –Trapezoidal Rule : Linear –Simpson’s 1/3-Rule : Quadratic –Simpson’s 3/8-Rule : Cubic –Boole’s Rule : Fourth-order

8 Numerical Integration Newton-Cotes Open Formulae -- Use only interior points –midpoint rule

9 Trapezoid Rule Straight-line approximation x0x0 x1x1 x f(x) L(x)

10 Trapezoid Rule Lagrange interpolation

11 Trapezoid Rule Integrate to obtain the rule

12 Example:Trapezoid Rule Evaluate the integral Exact solution Trapezoidal Rule

13 Simpson’s 1/3-Rule Approximate the function by a parabola x0x0 x1x1 x f(x) x2x2 hh L(x)

14 Simpson’s 1/3-Rule

15 Integrate the Lagrange interpolation

16 Simpson’s 3/8-Rule Approximate by a cubic polynomial x0x0 x1x1 x f(x) x2x2 hh L(x) x3x3 h

17 Simpson’s 3/8-Rule

18 Example: Simpson’s Rules Evaluate the integral Simpson’s 1/3-Rule Simpson’s 3/8-Rule

19 Midpoint Rule Newton-Cotes Open Formula ab x f(x) xmxm

20 Two-point Newton-Cotes Open Formula Approximate by a straight line x0x0 x1x1 x f(x) x2x2 hhx3x3 h

21 Three-Point Newton-Cotes Open Formula Approximate by a parabola x0x0 x1x1 x f(x) x2x2 hhx3x3 hhx4x4

22 Better Numerical Integration Composite integration –Composite Trapezoidal Rule –Composite Simpson’s Rule Richardson Extrapolation Romberg integration

23 Apply trapezoid rule to multiple segments over integration limits Two segments Four segmentsMany segments Three segments

24 Composite Trapezoid Rule x0x0 x1x1 x f(x) x2x2 hhx3x3 hhx4x4

25 Composite Trapezoid Rule Evaluate the integral

26 Composite Trapezoid Example

27 Composite Trapezoid Rule with Unequal Segments Evaluate the integral h 1 = 2, h 2 = 1, h 3 = 0.5, h 4 = 0.5

28 Composite Simpson’s Rule x0x0 x2x2 x f(x) x4x4 hhx n-2 hxnxn …... Piecewise Quadratic approximations hx3x3 x1x1 x n-1

29 Composite Simpson’s Rule Multiple applications of Simpson’s rule

30 Composite Simpson’s Rule Evaluate the integral n = 2, h = 2 n = 4, h = 1

31 Composite Simpson’s Example

32 Composite Simpson’s Rule with Unequal Segments Evaluate the integral h 1 = 1.5, h 2 = 0.5

33 Richardson Extrapolation Use trapezoidal rule as an example –subintervals: n = 2 j = 1, 2, 4, 8, 16, ….

34 Richardson Extrapolation For trapezoidal rule –k th level of extrapolation

35 Romberg Integration Accelerated Trapezoid Rule

36 Romberg Integration Accelerated Trapezoid Rule

37 Romberg Integration Example

38 Gaussian Quadratures Newton-Cotes Formulae –use evenly-spaced functional values Gaussian Quadratures –select functional values at non-uniformly distributed points to achieve higher accuracy –change of variables so that the interval of integration is [- 1,1] –Gauss-Legendre formulae

39 Gaussian Quadrature on [-1, 1] Choose (c 1, c 2, x 1, x 2 ) such that the method yields “exact integral” for f(x) = x 0, x 1, x 2, x 3 x2x2 x1x1 1

40 Gaussian Quadrature on [-1, 1] Exact integral for f = x 0, x 1, x 2, x 3 –Four equations for four unknowns

41 Gaussian Quadrature on [-1, 1] Choose (c 1, c 2, c 3, x 1, x 2, x 3 ) such that the method yields “exact integral” for f(x) = x 0, x 1, x 2, x 3,x 4, x 5 x3x3 x1x1 1 x2x2

42 Gaussian Quadrature on [-1, 1]

43 Exact integral for f = x 0, x 1, x 2, x 3, x 4, x 5

44 Gaussian Quadrature on [a, b] Coordinate transformation from [a,b] to [-1,1] t2t2 t1t1 ab

45 Example: Gaussian Quadrature Evaluate Coordinate transformation Two-point formula

46 Example: Gaussian Quadrature Three-point formula Four-point formula

47 Summary Integration Techniques –Trapezoidal Rule : Linear –Simpson’s 1/3-Rule : Quadratic –Simpson’s 3/8-Rule : Cubic –Boole’s Rule : Fourth-order Gaussian Quadrature

48 Homework Check the Homework webpage


Download ppt "Lecture 19 - Numerical Integration CVEN 302 July 22, 2002."

Similar presentations


Ads by Google