1 / 22

Numerical Methods

Numerical Methods. What computers can’t do. Solve (by reasoning) general mathematical problems  t hey can only repetitively apply arithmetic primitives to input. Solve problems exactly . Represent all numbers. Only a finite subset of the numbers between 0 and 1 can be represented.

jlouann
Download Presentation

Numerical Methods

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

  2. What computers can’t do • Solve (by reasoning) general mathematical problems  they can only repetitively apply arithmetic primitives to input. • Solve problems exactly. • Represent all numbers. Only a finite subset of the numbers between 0 and 1 can be represented.

  3. Numerical Integration • In NA, take visual view of integration as area under the curve • Many integrals that occur in science or engineering practice do not have a closed form solution – must be solved using numerical integration

  4. Trapezoidal Rule • The area under the curve from [a, fa] to [b, fb] is initially approximated by a trapezoid: I1 = ( b – a ) * ( fa + fb ) / 2

  5. Simple trapezoid over large interval is prone to error. Divide interval into halves…

  6. fc I2 = ( b – a )/2 * ( fa + 2*fc + fb ) / 2 (Note that interior sides count twice, since they belong to 2 traps.)

  7. Trapezoidal rule This gives us a better approximation than either left or right rectangles.

  8. Example Single Application of the Trapezoidal Rulef(x) = 0.2 +25x – 200x2 + 675x3 – 900x4 + 400x5Integrate f(x) from a=0 to b=0.8 Solution:f(a)=f(0) = 0.2 and f(b)=f(0.8) = 0.232

  9. Simpson’s rule • .. Another approach • Rather than use straight line of best fit, • Use parabola of best fit (curves) • Converges more quickly

  10. Simpson’s Rules • More accurate estimate of an integral is obtained if a high-order polynomial is used to connect the points. These formulas are called Simpson’s rules. Simpson’s 1/3 Rule: resultswhen a 2nd order Lagrange interpolating polynomial is used for f(x) a=x0x1 b=x2

  11. The Multiple-Application Simpson’s 1/3 Rule • Just as the trapezoidal rule, Simpson’s rule can be improved by dividing the integration interval into a number of segments of equal width. • However, it is limited to cases where values are equispaced, there are an even number of segments and odd number of points.

  12. Simpson’s rule Simpson’s rule can also be interpreted as fitting parabolas to sections of the curve. Simpson’s rule will usually give a very good approximation with relatively few subintervals.

  13. Simpson’s 3/8 Rule Fit a 3rd order Lagrange interpolating polynomial to four points and integrate Simpson’s 1/3 and 3/8 rules can be applied in tandem to handle multiple applications with odd number of intervals

  14. Equation 2 Rn APPROXIMATION • If we choose xi* to be the right endpoint, xi* = xi and we have: • The approximation Rniscalled right endpoint approximation.

  15. Mn APPROXIMATION • The figure shows the midpoint approximation Mn.

  16. THE MIDPOINT RULE • where and

  17. APPROXIMATE INTEGRATION • Approximate the integral with n = 5, using: a. Trapezoidal Rule • b. Midpoint Rule Example 1

  18. Example 1 a APPROXIMATE INTEGRATION • With n = 5, a = 1 and b = 2, we have: ∆x = (2 – 1)/5 = 0.2 • So, the Trapezoidal Rule gives:

  19. APPROXIMATE INTEGRATION Example 1 b • The midpoints of the five subintervals are: 1.1, 1.3, 1.5, 1.7, 1.9

  20. Example 1 b APPROXIMATE INTEGRATION • So, the Midpoint Rule gives:

  21. Example 3 ERROR ESTIMATES • Use the Midpoint Rule with n = 10 to approximate the integral • Give an upper bound for the error involved in this approximation.

  22. Example 3 a ERROR ESTIMATES • As a = 0, b = 1, and n = 10, the Midpoint Rule gives:

More Related