Numerical integration continued Simpsons rules We can add

  • Slides: 21
Download presentation
Numerical integration continued --Simpson’s rules - We can add more segments OR - We

Numerical integration continued --Simpson’s rules - We can add more segments OR - We can use a higher order polynomial

Simpson’s 1/3 rule • use a second order interpolating polynomial If we use Lagrange

Simpson’s 1/3 rule • use a second order interpolating polynomial If we use Lagrange form

Integrate and do some algebra

Integrate and do some algebra

If we use a=x 0 and b=x 2, and x 1=(b+a)/2 width Average height

If we use a=x 0 and b=x 2, and x 1=(b+a)/2 width Average height Error for Simpson’s 1/3 rule

As with Trapezoidal rule, can use multiple applications of Simpson’s 1/3 rule • need

As with Trapezoidal rule, can use multiple applications of Simpson’s 1/3 rule • need even number of segments, odd number of points 9 points, 4 segments

As in multiple trapzoid, break integral up Substitute Simpson’s 1/3 rule for each integral

As in multiple trapzoid, break integral up Substitute Simpson’s 1/3 rule for each integral and collect terms

Example: Numerically integrate from 0 to 1 using 1) single trapezoid, 2) multiple trapezoid,

Example: Numerically integrate from 0 to 1 using 1) single trapezoid, 2) multiple trapezoid, 3) single Simpson’s 1/3 and 4) multiple Simpson’s 1/3

True, analytic value of I is 0. 4749

True, analytic value of I is 0. 4749

1) Single trapezoidal rule Really quite bad

1) Single trapezoidal rule Really quite bad

2) Multiple trapezoidal rule

2) Multiple trapezoidal rule

3) Single Simpson’s 1/3 rule

3) Single Simpson’s 1/3 rule

4) Multiple Simpson’s 1/3 rule

4) Multiple Simpson’s 1/3 rule

Simpson’s 1/3 rule is limited to • applications with equally-spaced data • even number

Simpson’s 1/3 rule is limited to • applications with equally-spaced data • even number of segments • odd number of points Simpson’s 3/8 rule used when there are • odd number of segments • even number of points

Simpson’s 3/8 rule uses a third order Lagrange polynomial Four equally spaced points, separated

Simpson’s 3/8 rule uses a third order Lagrange polynomial Four equally spaced points, separated by or

Can do multiple segment application of Simpson’s 3/8 rule. Can also mix and match

Can do multiple segment application of Simpson’s 3/8 rule. Can also mix and match Simpson’s 1/3 and 3/8 to fill up segments

Example: 12 points, 11 segments Each 3/8 rule application takes 3 segments Each 1/3

Example: 12 points, 11 segments Each 3/8 rule application takes 3 segments Each 1/3 rule application takes 2 segments

Neither 2 nor 3 go into 11 But 3 3’s and a 2 do.

Neither 2 nor 3 go into 11 But 3 3’s and a 2 do. 3/8 rule 1/3 rule 3/8 rule

Higher order Newton-Cotes closed formulas Simpson’s 1/3 - 2 nd order Lagrange Simpson’s 3/8

Higher order Newton-Cotes closed formulas Simpson’s 1/3 - 2 nd order Lagrange Simpson’s 3/8 - 3 rd order Lagrange we can keep going but don’t usually - Simpson is accurate enough when applied in multiple segments

Integration with unequal segments If all unequal, stuck with multiple trapezoid rule application If

Integration with unequal segments If all unequal, stuck with multiple trapezoid rule application If you can find some sets of equal segments, use Simpson’s rules