m17 Integration

  • View
    40

  • Download
    0

Embed Size (px)

Text of m17 Integration

Chap. 17 (Numerical Integration)CAE

Simpson

1

Chap.17

b

a

f ( x ) dx

: [a, b] f(x)

=>

2

Chap.17

3

Chap.17

(Trapezoid rule)

f ( x ) dx =a

b

3 ba [ f ( a ) + f (b ) ] (b a ) f " ( ) 2 12

4

Chap.17

f ( x) = 0.2 + 25 x 200 x 2 + 675 x 3 900 x 4 + 400 x 5

P. 453 17.1

5

Chap.17

ba , x0 = a, xn = b nx1 x0

let h = I =b a

f ( x ) dx

f ( x ) dx + ... +

xn

xn 1

f ( x ) dx

Et =

(b a ) 3 12 n 3

f " ( ) = i i =1

n

(b a ) 3 1 f " Et 2 12 n 2 n

: 1

6

Chap.17

M Filefunction I = trap(func,a,b,n) % I = trap(func,a,b,n): % multiple-application trapezoidal rule. % input: % func = name of function to be integrated % a, b = integration limits % n = number of segments % output: % I = integral estimate x = a; h = (b - a)/n; s = feval(func,a); for i = 1 : n-1 x = x + h; s = s + 2*feval(func,x); end s = s + feval(func,b); I = (b - a) * s/(2*n);

P. 456 17.2

I =

h 2

n 1 f ( xi ) + f ( x n ) f ( x0 ) + 2 i =1

7

Chap.17

Simpson : Simson :

Simson 1/3 :

Simson 3/8 : 3

8

Chap.17

Simpson 1/3 Lagrange (2)

P. 460 17.3

L( x) =

( x x0 )( x x2 ) ( x x0 )( x x1 ) ( x x1 )( x x2 ) f ( x0 ) + f ( x1 ) + f ( x2 ) ( x0 x1 )( x0 x2 ) ( x1 x2 )( x1 x2 ) ( x2 x0 )( x2 x1 )

where h =Et =

ba , x0 = a, x1 = x0 + h, x2 = b 2: 3

h 5 (4) (b a ) 5 ( 4 ) f ( ) = f ( ) 2880 90

9

Chap.17

Simpson 1/3 rule

Et =

h 5 ( 4) f ( ) 90 (b a) 5 ( 4 ) = f ( ) 180n 4

Et

1 n4

P. 462 17.4

10

Chap.17

Simpson 3/8 ( x x1 )( x x 2 )( x x3 ) ( x x0 )( x x 2 )( x x3 ) f ( x0 ) + f ( x1 ) ( x0 x1 )( x0 x2 )( x0 x3 ) ( x1 x0 )( x1 x 2 )( x1 x3 ) ( x x0 )( x x1 )( x x3 ) ( x x0 )( x x1 )( x x 2 ) f ( x2 ) + f ( x3 ) ( x2 x0 )( x 2 x1 )( x 2 x3 ) ( x3 x0 )( x3 x1 )( x3 x 2 )

L( x) =

+

where h =

ba , x0 = a, x1 = x0 + h, x2 = x0 + 2h, x3 = b 3

11

Chap.17

Simpson 3/8

Et =

3h 5 ( 4 ) f ( ) 80 (b a) 5 ( 4 ) f ( ) = 6480

Simson 1/3 : 2880 Simson 3/8 : 6480

P. 464 17.5

12

Chap.17

Newton-Cotes

Simpson 1/3 (3 points) 3/8 (4 points) (segment) - (point) Simpson 1/3 ( )13

Chap.17