Presentation is loading. Please wait.

Presentation is loading. Please wait.

Use of Newton-Cotes Formulas and eventual shortcomings Matlab code to increase number of segments with trapezoid, 1/3 and 3/8 rule.

Similar presentations


Presentation on theme: "Use of Newton-Cotes Formulas and eventual shortcomings Matlab code to increase number of segments with trapezoid, 1/3 and 3/8 rule."— Presentation transcript:

1 Use of Newton-Cotes Formulas and eventual shortcomings Matlab code to increase number of segments with trapezoid, 1/3 and 3/8 rule

2 Methods to achieve better accuracy at lower effort have been developed Romberg integration - uses Richardson extrapolation Idea behind Richardson extrapolation - improve the estimate at iteration j by using information from iteration j-1

3 True integral value can be written This is true for any iteration Using

4 So and which leads to

5 Plugging back into If

6 Combine two O(h2) estimates to get an O(h4) estimate Can also combine two O(h4) estimates to get an O(h6) estimate Can combine two O(h6) estimates to get an O(h8) estimate

7 General pattern is called Romberg Integration j - level of accuracy - j+1 is more accurate (more segments) k - level of integration - k=1 is original trapezoid estimate (O(h2)), k=2 is improved (O(h4)), etc.

8 Excel example

9 Gauss quadrature Idea is that if we evaluate the function at certain points, and sum with certain weights, we will get accurate integral Evaluation points and weights are tabulated

10 Development of Gauss-Legendre quadrature Assume a and b are limits of integration Trapezoid rule should give exact results for constant function or straight line

11 Trapezoid rule always works in these cases

12 Now instead of trapezoid, which has fixed end points (a,b), let them float 4 unknowns - x0,x1,c0,c1 4 equations - constant, linear (had before), quadratic, cubic From -1 to 1 to simplify math

13 Can solve these equations to get and two point Gauss-Legendre formula

14 Used cubic so this is third order accurate To go to -1 to 1 from other limits - use linear transformation If lower limit is a If upper limit is b

15 Solve and get So that

16 Example: Evaluate using two-point Gauss quadrature Exact value is 0.512076

17 First transform Substituting

18 Evaluate that equation atand So the integral is 0.630444 Et is 23% - better than single application of Simpson’s 1/3

19 Can develop higher order Gauss-Legendre forms using Values for c’s and x’s are tabulated Use the same transformation

20 Example: do the same integral using 6-point Gauss Legendre quadrature Evaluate at these x and multiply by c

21 A final example: Determine mass of concrete slab Slab shape

22 Mass is density times volume Volume is thickness times area Say thickness is 1 ft Determine area

23 Take measurements at chosen points use symmetry 30 ft 27 ft

24 Symmetry of slab around x-axis Find area of one half and X 2

25 Use Simpson’s 1/3 rule Area for 1/2 is 265.22 ft 2

26


Download ppt "Use of Newton-Cotes Formulas and eventual shortcomings Matlab code to increase number of segments with trapezoid, 1/3 and 3/8 rule."

Similar presentations


Ads by Google