Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫...

22
11/28/2007 1 Numerical Integration Quadrature

Transcript of Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫...

Page 1: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

1

Numerical Integration

Quadrature

Page 2: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

2

Newton-Cotes Quadrature(quadrature based on polynomial interpolation)

Page 3: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

3

Integration

∫=b

adx)x(fI

The process of measuring the area under a curve.

Where:

f(x) is the integrand

a= lower limit of integration

b= upper limit of integration

f(x)

a b

y

x

∫b

a

dx)x(f

Approximate f (x) by a straight line

Page 4: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

4

Derivation of trapezoidal rule from Lagrange Polynomial

Integrate P1 to get trapezoidal rule Integrate E1 to get the truncation error/degree of precision

Approximate f (x) by a quadratic curve

Page 5: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

5

Derivation of Simpson’s rule from Lagrange Polynomial

Integrate P2 to get Simpson’s rule Integrate E2 to get the truncation error/degree of precision

Approximate f (x) by a cubic curve

Page 6: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

6

For a fair comparison of various methods use the same number of function evaluations in each method.E.g. Five evaluations in [x0,x4]

composite trapezoidal rule

composite Simpson’s rule

Page 7: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

7

Page 8: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

8

Page 9: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

9

Page 10: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

10

.

.

Apply Simpson’s Rule over each interval,

...)x(f)x(f)x(f)xx(dx)x(fb

a+⎥⎦

⎤⎢⎣⎡ ++

−=∫ 64 210

02

f(x)

. . .

x0 x2 x2M

-2

x2M

x

.....dx)x(fdx)x(fdx)x(fx

x

x

x

b

a++= ∫∫∫

4

2

2

0

∫−

+M

M

x

x

dxxf2

22

)(

⎥⎦⎤

⎢⎣⎡ ++

−+ −−− 6

)()(4)()( 21222222

MMMMM

xfxfxfxx

Composite Simpson’s Rule

hxx ii 22 =− −

Then

...)x(f)x(f)x(fhdx)x(fb

a+⎥⎦

⎤⎢⎣⎡ ++

=∫ 642 210

...)x(f)x(f)x(fh +⎥⎦⎤

⎢⎣⎡ ++

+6

42 432

⎥⎦⎤

⎢⎣⎡ ++

+ −−

6)()(4)(2 21222 MMM xfxfxfh

Composite Simpson’s Rule

∫b

adx)x(f { }[ ]...)(...)()(4)(

3 12310 +++++= −Mxfxfxfxfh

{ } )}]()(...)()(2... 22242 MM xfxfxfxf +++++ −

( )⎥⎥⎥

⎢⎢⎢

⎡++= −

=−∑ )()(4)(

3 2121

22 ii

M

ii xfxfxfh

Page 11: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

11

Recursive Rules

Page 12: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

12

Page 13: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

13

Page 14: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

14

Romberg Integration

recall that

Page 15: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

15

Romberg IntegrationThe pattern for integration rules of increasing accuracy is of the form:

.....

Romberg Integration relies on Richardson’s extrapolation

Page 16: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

16

Page 17: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

17

Page 18: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

18

Gauss Quadrature

Page 19: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

19

Basis of the Gaussian Quadrature Rule

Previously, the Trapezoidal Rule can be developed by the methodof undetermined coefficients as:

)b(fc)a(fcdx)x(fb

a21 +≅∫

)b(fab)a(fab22−

+−

=

Basis of the Gaussian Quadrature Rule

The two-point Gauss Quadrature Rule is an extension of the Trapezoidal Rule approximation where the arguments of the function are not predetermined as a and b but as unknownsx1 and x2. In the two-point Gauss Quadrature Rule, the integral is approximated as

∫=b

adx)x(fI )x(fc)x(fc 2211 +≈

Page 20: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

20

To find wi, xi we need four conditions = find wi, xi so that the integration rule has degree of precision 3

Page 21: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

21

Page 22: Numerical Integration - boun.edu.trweb.boun.edu.tr/ozupek/me303/integration_web.pdfIntegration = ∫ b a I f(x)dx The process of measuring ... 11/28/2007 4 Derivation of trapezoidal

11/28/2007

22