Download presentation
Presentation is loading. Please wait.
Published byJanel Butler Modified over 9 years ago
1
5. Integration 2.Quadrature as Box Counting 3.Algorithm: Trapezoid Rule 4.Algorithm: Simpson’s Rule 5.Integration Error 6.Algorithm: Gaussian Quadrature 7.Empirical Error Estimate 8.Experimentation 9.Higher Order Rules
2
5.2. Quadrature as Box Counting Riemann: Numerical:w = weight Keeping N finite can still give exact results, e.g., polynomials. Aim: accurate result for small N. No universal “best” algorithm.
3
Tips Remove singularities first. By putting them at endpoints of sub-intervals By change of variable. Speed up or slow down (by change of variable or step size) in slowly or rapidly varying region.
4
Algorithms for Evenly Spaced Points Evenly spaced points : NameDegreewiwi Trapezoid1 Simpson’s2 3/83 Milne4
5
8.3.Algorithm: Trapezoid Rule
6
5.4.Algorithm: Simpson’s Rule
7
N = odd
9
5.5.Integration Error Expand f at middle of interval x [ h, h ] : Error, Trapezoid : Error, Simpson : n data points in each interval n = 2 n = 4 Relative error :
10
n = 2,4 for t, s Round-off error is random : m machine precision ~ 10 7 ( single prec) ~ 10 15 ( double prec) Min tot : Set scale to Trapezoid : Simpson :
11
Conclusions Simpson’s rule is better than trapezoid. It’s possible to get tot m. Best result is obtained for N ~ 1000 instead of .
12
5.6.Algorithm: Gaussian Quadrature where is the n th degree member of a complete set of orthogonal polynomials, and { x k } are its roots. I = S if f is an 2n-1 degree polynomial. Proof : IntegralPolynomialweightLimits Legendre1 ( 1, 1 ) Hermite exp( x 2 )( , ) Laguerre exp( x )( , ) Chebyshev I ( 1 x 2 ) 1/2 ( 1, 1 )
13
5.6.1.Mapping Integration Points An integralcan be transformed into by the linear transform Thus
14
An integralcan be transformed into by the linear transform Thus
15
Similarly, one get the following transforms IntervalWy [ a, b ] [ 0, ] [ , ] [ b, ] [ 0, b ]
16
5.7.Empirical Error Estimate (Ex.5.1)
18
Relative error,, as a function of N for the trapezoid, Simpson, & Gaussian methods, in the calculation of Answer
19
5.8.Experimentation Evaluate and What’s wrong ?
20
5.9.Higher Order Rules Let A(h) be the numerical evaluation of an integral with leading error h 2, i.e., Romberg’s extrapolation see Burden, § 4.5
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.