+ All Categories
Home > Documents > ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 30 Numerical Integration &...

ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 30 Numerical Integration &...

Date post: 19-Dec-2015
Category:
View: 234 times
Download: 0 times
Share this document with a friend
Popular Tags:
22
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 30 Numerical Integration & Differentiation
Transcript

ECIV 301

Programming & Graphics

Numerical Methods for Engineers

Lecture 30

Numerical Integration

& Differentiation

In SummaryNewton-Cotes Formulas

Replace a complicated function or tabulated data with an approximating

function that is easy to integrate

b

a

n

b

a

dxxfdxxfI

nn

nnon xaxaxaaxf

111

In Summary

Also by piecewise approximation

b

ax

x

x

n

b

a

i

i

i

dxxf

dxxfI

1

Closed/Open Forms

CLOSED OPEN

Trapezoidal RuleLinear Interpolation

12

3hOError

Trapezoidal Rule Multiple Application

Trapezoidal Rule Multiple Application

Trapezoidal Rule Multiple Application

n

xfxfxfabI

n

n

ii

2

22

10

x a=xo x1 x2 … xn-1 b=xn

f(x) f(x0) f(x1) f(x2) f(xn-1) f(xn)

Simpson’s 1/3 Rule

Quadratic Interpolation

22102 )( xaxaaxf

90

5hOError

Simpson’s 3/8 Rule

Cubic Interpolation

33

22102 xaxaxaa)x(f

80

3 5hOError

Gauss Quadrature

x1 x2

2211 xfwxfwI

General Case

2211

1

1

xfwxfwdx)x(fI

Gauss Method calculates pairs of wi, xi for the Integration limits

-1,1

For Other Integration LimitsUse Transformation

Gauss Quadrature

b

a

dx)x(fIGxaax 10

10 aaa

10 aab

For xg=-1, x=a

For xg=1, x=b

20

aba

21

aba

Gauss Quadrature

b

a

dx)x(fI

2

Gxababx

Gdx

abdx

2

1

12dx)x(f

abdx)x(fI

b

a

Gauss Quadrature

1

12dx)x(f

abdx)x(fI

b

a

n

ii xfwab

I12

Gauss Quadrature

Points

Weighting Factors wi

Function Arguments

Error

2 W0=1.0 X0=-0.577350269 F(4)()

W1=1.0 X1= 0.577350269

3 W0=0.5555556 X0=-0.77459669 F(6)()

W1=0.8888888 X1=0.0

W2=0.5555556 X2=0.77459669

Gaussian Points

Points

Weighting Factors wi

Function Arguments

Error

4 W0=0.3478548 X0=-0.861136312 F(8)()

W1=0.6521452 X1=-339981044

W2=0.6521452 X2=- 339981044

W3=0.3478548 X3=0.861136312

Gaussian Quadrature

Not a good method if function is not available

Fig 23.1FORWARD FINITE DIFFERENCE

Fig 23.2BACKWARD FINITE DIFFERENCE

Fig 23.3CENTERED FINITE DIFFERENCE

Data with Errors


Recommended