1 / 17

Integration

Integration. COS 323. Numerical Integration Problems. Basic 1D numerical integration: Given ability to evaluate f ( x ) for any x , find Goal: best accuracy with fewest samples Other problems (future lectures): Improper integration Multi-dimensional integration

orsin
Download Presentation

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. Integration COS 323

  2. Numerical Integration Problems • Basic 1D numerical integration: • Given ability to evaluate f(x) for any x, find • Goal: best accuracy with fewest samples • Other problems (future lectures): • Improper integration • Multi-dimensional integration • Ordinary differential equations • Partial differential equations

  3. f(b) f(a) a b Trapezoidal Rule • Approximate function by trapezoid

  4. f(b) f(a) a b Trapezoidal Rule

  5. f(b) f(a) a b a b Extended Trapezoidal Rule Divide into segments of width h:

  6. Trapezoidal Rule Error Analysis • How accurate is this approximation? • Start with Taylor series for f(x) around a

  7. Trapezoidal Rule Error Analysis • Expand LHS: • Expand RHS

  8. Trapezoidal Rule Error Analysis • So, • In general, error for a single segment proportional to h3 • Error for subdividing entire ab interval proportional to h2 • “Cubic local accuracy, quadratic global accuracy”

  9. Determining Step Size • Change in integral when reducing step sizeis a reasonable guess for accuracy • For trapezoidal rule, easy to go from h  h/2without wasting previous samples a b

  10. Simpson’s Rule f(b) • Approximate integral byparabola throughthree points • Better accuracy for same # of evaluations f(a) a b

  11. Richardson Extrapolation • Better way of getting higher accuracy for agiven # of samples • Suppose we’ve evaluated integral for step sizeh and step size h/2: • Then

  12. Richardson Extrapolation • This treats the approximation as a function of h and “extrapolates” the result to h=0 • Can repeat: –1/3 –1/15 4/3 16/15 –1/63 64/63

  13. Open Methods • Trapezoidal rule won’t work if function undefined at one of the points where evaluating • Most often: function infinite at one endpoint • Open methods only evaluate function on the open interval (i.e., not at endpoints)

  14. a b Midpoint Rule • Approximate function by rectangle evaluated at midpoint

  15. a b a b Extended Midpoint Rule Divide into segments of width h:

  16. Midpoint Rule Error Analysis • Following similar analysis to trapezoidal rule,find that local accuracy is cubic,quadratic global accuracy • Formula suitable for adaptive method,Richardson extrapolation,but can’t halve intervals withoutwasting samples

  17. Discontinuities • All the above error analyses assumed nice (continuous, differentiable) functions • In the presence of a discontinuity, all methodsrevert to accuracy proportional to h • Locally-adaptive methods: do not subdivideall intervals equally, focus on those with large error(estimated from change with a single subdivision)

More Related