Download Simpson`s Rule

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Multidisciplinary design optimization wikipedia , lookup

Simulated annealing wikipedia , lookup

False position method wikipedia , lookup

Clenshaw–Curtis quadrature wikipedia , lookup

Transcript
Numerical Integration using Trapezoidal Rule
or Simpson’s Rule
Approximating Areas with Trapezoidal Rule or Simpson’s
Rule
Using integrals to find area works extremely well as long
as we can find the antiderivative of the function.
Sometimes, the function is too complicated to find the
antiderivative.
At other times, we don’t even have a function, but only
measurements taken from real life.
What we need is an efficient method to estimate area
when we can not find the antiderivative.

3
1 2
y  x 1
8
0 x4
Actual area under curve:
A
4
0
1 2
x  1 dx
8
2
1
0
1
2
3
4
20
A
 6.6
3

3
1 2
y  x 1
8
0 x4
Left-hand rectangular
approximation (n = 4):
2
1
0
1
1
8
1
2
2
1
8
3
4
3
4
Approximate area: 1  1  1  2  5  5.75
(too low)

3
1 2
y  x 1
8
0 x4
2
Right-hand rectangular
approximation (n =4):
1
0
1
8
1
2
1
2
1
8
3
4
3
4
Approximate area: 1  1  2  3  7  7.75
(too high)

• A more accurate
approximation can be
obtained if the subintervals
are treated as trapezoids
instead of rectangles.
h
A  (b1  b2 )
2
3
2
1
0
1
2
3
Averaging right and left rectangles gives us trapezoids:
1  9  1  9 3  1  3 17  1  17

T  1              3 
2 8 28 2 22 8  2 8

4
3
2
1
0
1
2
3
4
1  9  1  9 3  1  3 17  1  17

T  1              3 
2 8 28 2 22 8  2 8

1  9 9 3 3 17 17

T  1        3 
2 8 8 2 2 8 8

1  27 
T  
2 2 
27

 6.75
4

Trapezoidal Rule:
h
T   y0  2 y1  2 y2  ...  2 yn1  yn 
2
( h = width of subinterval = b  a )
n
This rule can be used only if h is constant;
otherwise, use trapezoid area formula to find area
of each subinterval and then sum all subintervals.
This gives us a better approximation than either left
or right rectangles.
Note: This rule and the trapezoid area formula must
be memorized for the AP exam.

Simpson’s Rule:
h
S   y0  4 y1  2 y2  4 y3  ...  2 yn  2  4 yn 1  yn 
3
( h = width of subinterval, n must be even )
Example: y  1 x 2  1
8
3
1
9
3
17

S  1  4   2   4   3 
3
8
2
8

1 9
17

 1   3   3 
3 2
2

2
1
0
1
2
3
4
1
  20   6.6
3
Simpson’s rule can also be interpreted as fitting parabolas
to sections of the curve, which is why this example came
out exactly.
Simpson’s rule will usually give a very good approximation
with relatively few subintervals.
It is especially useful when we have no equation and the
data points are determined experimentally.

The widths in meters of a kidney-shaped pool
were taken at 2-m intervals. Use the Trapezoidal
Rule to estimate the area of the pool.
p