1 / 11

Chapter 8

Chapter 8. Numerical Integration Lecture (II) 1. 1 Ref.: “Applied Numerical Methods with MATLAB for Engineers and Scientists”, Steven Chapra, 2 nd ed., Ch. 17 , McGraw Hill, 2008. Outline. Newton-cotes formulas (2) Simpson’s 1/3 rule

marlin
Download Presentation

Chapter 8

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. Chapter 8 Numerical Integration Lecture (II)1 1 Ref.: “Applied Numerical Methods with MATLAB for Engineers and Scientists”, Steven Chapra, 2nd ed., Ch. 17, McGraw Hill, 2008. Dr. Jie Zou PHY3320

  2. Outline • Newton-cotes formulas • (2) Simpson’s 1/3 rule • The single and composite applications of Simpson’s 1/3 rule • Integration with unequal segments • Example: By hand and Implementation in MATLAB Dr. Jie Zou PHY3320

  3. Simpson’s rules: in general • General Simpson’s rules: To use higher-order polynomials to connect the points; the formulas that result from taking the integrals under these polynomials are called Simpson’s rules. • Trapezoidal rule • Simpson’s rules Dr. Jie Zou PHY3320

  4. Translate the y axis y’ x’ -h O’ h Simpson’s 1/3 rule • Simpson’ 1/3 rule: It corresponds to using second-order polynomials. • Derivation of the formula: • Translate the y axis • Using the Lagrange form for a quadratic fit of three points, (-h, f(x0)), (0, f(x1)), (h, f(x2)): • Integration over the interval [-h, h]: h h = (b – a)/2 Ref. Fig. 17.11 (a) Simpson’s 1/3 rule consists of taking the area under a parabola connecting three points.

  5. Error of the Simpson’s 1/3 rule • For a single application of the Simpson’s 1/3 rule: •  lies somewhere in the interval from a to b. • The error is proportional to h5(rather than h3 for the trapezoidal rule); Simpson’s 1/3 rule is more accurate than the trapezoidal rule. • The error is proportional to the fourth-derivative of the actual function; if f(x) is a cubic polynomial, Et = 0. Dr. Jie Zou PHY3320

  6. Example: Single application of Simpson’s 1/3 rule • Ref. Example 17.3: Use Simpson’s 1/3 rule to integrate f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 from a = 0 to b = 0.8. Also, find the error Et and t. Compare the result with that found using the Trapezoidal rule (Itrue = 1.640533). • By hand. • Results: t = 16.6% for the Simpson’s 1/3 rule; t = 89.5% for the Trapezoidal rule. The Simpson’s 1/3 rule (single) Dr. Jie Zou PHY3320 The Trapezoidal rule (single)

  7. The composite Simpson’s 1/3 rule • Simpson’s rule can be improved by dividing the integration interval into a number of segments of equal width. • Note: The number of segments has to be even. • h = step size = (b-a)/n; n = the number of segments. Ref. Fig. 17.12 Composite Simpson’s 1/3 rule

  8. Error of the composite Simpson’s 1/3 rule • For a composite application of the Simpson’s 1/3 rule: • The error is proportional to 1/n4 (rather than 1/n2 for the composite trapezoidal rule). • The average f(4)(x) for the interval:

  9. Example: Composite application of the Simpson’s 1/3 rule • Example 17.4 (Ref.): Use the Composite Simpson’s 1/3 rule with n = 4 to estimate the integral of f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4 + 400x5 from a = 0 to b = 0.8. Also, find the error Et and t (Itrue = 1.640533). • By hand. • Results: t = 1.04% for the Composite Simpson’s 1/3 rule. n = 4; h = 0.2 Dr. Jie Zou PHY3320

  10. Integration with unequal segments • In practice, the data points may be unequally spaced. For example, experimentally obtained data. • Numerical integration: One method is to apply the trapezoidal rule to each segment and sum the results: • hi = the width (step size) of segment i. Dr. Jie Zou PHY3320

  11. Example: Integration with unequal segments • Example 17.6 (Ref.): Determine the integral for the data given in the Table below. Write an M-file, Int_Unequal_Segments.m. (Itrue = 1.640533). Dr. Jie Zou PHY3320

More Related