Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Numerical Methods in Engineering-Lecture 18 Slides-Civil Engineering and Geological Sciences, Slides of Numerical Methods in Engineering

Each formula and error is for one sub-interval with N 1 data/node/integration points. We can extend the interval to [a,b] by summing integrals and errors (error increases by one order). Numerical Integration, Simpson’s 1/3 Rule, Error, Extended Simpson’s 1/3 Rule, Newton Cotes Closed Formulae, Newton Cotes Open Formulae, Lagrange Quadratic Interpolation

Typology: Slides

2011/2012

Uploaded on 02/20/2012

damyen
damyen 🇺🇸

4.4

(27)

274 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CE 341/441 - Lecture 18 - Fall 2004
p. 18.1
LECTURE 18
NUMERICAL INTEGRATION CONTINUED
Simpson’s 1/3 Rule
Simpson’s 1/3 rule assumes 3 equispaced data/interpolation/integration points
The integration rule is based on approximating using Lagrange quadratic (second
degree) interpolation.
The sub-interval is defined as [xo,x2] and the integration point to integration point
spacing equals
79
fx()
hx2xo
2
----------------
f0
f1
x0x1
f(x)
g(x)
f2
x2
hh
x0=0 x1=h x2=2h coordinate shift
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Numerical Methods in Engineering-Lecture 18 Slides-Civil Engineering and Geological Sciences and more Slides Numerical Methods in Engineering in PDF only on Docsity!

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

LECTURE 18NUMERICAL INTEGRATION CONTINUEDSimpson’s 1/3 Rule • Simpson’s 1/3 rule assumes 3 equispaced data/interpolation/integration points• The integration rule is based on approximating

using

Lagrange quadratic

(second

degree) interpolation.

  • The sub-interval is defined as [

x

o

,x

2

] and the integration point to integration point

spacing equals

79

f

x (

h

x

2

x

o

f

0

f

1

x

0

x

1 f

(x)

g(x)

f

2

x

2

h

h

x

0

x

1

=h

x

2

=2h

coordinate shift

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • Lagrange quadratic interpolation over the sub-interval:

where

⇒ ⇒ ⇒

g x

f

o

V

o

x (

f

^1

V

^1

x (

f

^2

V

^2

x (

V

o

x (

x

x

1

x

x

2

x

o

x

1

x

o

x

2

V

o

x (

x

2

hx

h

2

h

2

V

^1

x (

x

x

o

x

x

2

x

1

x

o

x

1

x

2

V

^1

x (

hx

x

2

h

2

V

^2

x (

x

x

o

x

x

1

x

2

x

o

x

2

x

1

V

^2

x (

x

2

hx

  • 2

h

2

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

Evaluation of the Error for Simpson’s 1/3 Rule • Error is defined as:

  • We develop Taylor series expansions for

and

about

E

I

h --- 3

f

o

f

^1

f

^2

E

f

x (

x

h --- 3

f

o

f

^1

f

^2

d

0 2

h

f

x (

f

o

f

^1

f

^2

x

1

h

f

x (

f

^1

x

h

f

1 (

)

1

x

h

2

f

2 (

)

1

x

h

3

f

3 (

)

1

x

h

4

f

4 (

)

1

O x

h

5

f

o

f

^1

h f

1 (

)

1

h

2

f

^1

2 (

)

h

3 6


f

3 (

)

1

h

4

f

4 (

)

1

O h

5

f

^1

f

^1

f

^2

f

^1

h f

1 (

)

1

h

2

f

2 (

)

1

h

3 ----^6

f

3 (

)

1

h

4

f

4 (

)

1

O h

5

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • Substituting into the expression for

⇒ ⇒

E

E

f

^1

x

h

f

1 (

)

1

x

h

2

f

2 (

)

1

x

h

3

f

3 (

)

1

x

h

4

f

4 (

)

1

O x

h

5

x d

0 2

h

h --- 3

f

^1

h f

1 (

)

1

h

2

f

2 (

)

1

h

3 6


f

3 (

)

1

h

4

f

^1

4 (

)

O h

5

f

^1

f

^1

h f

^1

1 (

)

h

2

f

^1

2 (

)

h

3 6


f

3 (

)

1

h

4

f

4 (

)

1

O h

5

E

h

f

^1

h

2

h

2

f

1 (

)

1

h

3

h

3

f

2 (

)

1

h

4

h

4

f

3 (

)

1

h

5

h

5

f

4 (

)

1

O h

6

h --- 6 3

f

^1

h

2

f

2 (

)

1

h

4

f

4 (

)

1

O h

5

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

Extended Simpson’s 1/3 Rule • Simply add up integrated values obtained using Simpson’s 1/3 rule over each sub-

interval.

80

  • Sub-interval size =• Number of sub-intervals =• Sub-interval width is 2

h

while the integration point to integration point spacing is

equal to

f a

0

f

1

f

2

f

N b

x

f

(x)

f

3

f

4

f

(x)

sub-int. 1

h

h

sub-int. 2

h

N ---^2

h

b

a

  • N

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • Again we integrate over

points (the same as extended trapezoidal rule). Therefore

  • In general we can write

N

I

f

x (

x d

b ∫ a

I

h --- 3

f

o

f

^1

f

^2

f

^2

f

^3

f

^4

f

^4

f

^5

f

^6

f

N

4

f

N

3

f

N

2

f

N

2

f

N

1

f

N

E

a b

,

[

]

I

h --- 3

f

o

f

^1

f

^2

f

^3

f

^4

f

^5

f

N

2

f

N

1

f

N

[

]

E

a b

, [

]

I

h --^3

f a

f b

f a

ih

+

f a

ih

+

i^

2 2

,

N =

2

i^

1 2

,

N =

1

E

a b

,

[

]

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • However we wish dependence on error to be expressed in terms of

not

in terms of the

number of integration points.

  • Noting that for the interval

  • Therefore

  • Overall the error is 4th order

h

a b

[

]

h

b

a

  • N

N

b

a

  • h

E

a b

,

[

]

h

5 ----- 90

b

a

  • h

f

4 (

)

E

a b

,

[

]

h

4

-------- 180

b

a

f

4 (

)

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

Newton Cotes Closed Formulae • Derived by integrating Lagrange approximating polynomials (or equivalently Newton

Interpolating

formulae)

using

equispaced

integration

points

(interpolating

points,

nodes, etc.) over the sub-interval defined by the interpolating data points

81 • The general form of Newton-Cotes closed formulae:

where

f

0

f

1

f

2

f

N

h

= x

0

x

s

x

1

x

2

= x

N

x

E

g(x)

f

x (

x d

x

S x

E ∫

α

h w

o

f

o

w

1

f

^1

w

2

f

^2

w

N

f

N

[

]

E

f

i

f

x

i

(

x

i

x

S

ih

h

x

N

x

o

– N

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • Notes
    • All these formulae integrate over one sub-interval only. They can be extended over

simply by summing up integrals over each sub-interval.

  • In addition the error is summed resulting in one less order of accuracy than the error

over the individual sub-interval!

  • Accuracy for Simpson’s

rule is very similar to accuracy of Simpson’s

rule.

  • In general each formula will be

exact

for polynomials of one degree less than the

order of the derivatives in the error terms.

linear

linear

quadratic

cubic

cubic

cubic

quartic

quintic

a b

[

]

N

g x

E

Exact for

f

2 (

)

f

4 (

)

f

4 (

)

f

6 (

)

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • It appears that for

even, the integration is exact for polynomials one degree greater

than the interpolation function.

  • For Simpson’s 1/3 Rule:
    • It turns out that if

is a

cubic

and

is quadratic,

82

  • The errors cancel over the interval

due to the location

of point

  • We can actually improve the accuracy of integration formulae by locating integration

points in special locations!

  • We do

not

experience any improvement in accuracy for

N

= odd.

N f

x (

g x

E

x

o

x

1

,

[

]

E

x

1

x

2

,

[

]

f

0

f

1

f

2

x

0

x

1

x

g(x)^2

N = 2

f

(x)

E[x

0

,x

1

]

E[x

1

,x

2

]

x

1

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • Newton Cotes open formula:

Error compared to closed

interval

Interval size compared to

closed interval

f

x (

x d

x

S x

E ∫

α

h w

0

f

^0

w

1

f

^1

w

N

f

N

[

]

E

N

α

w

i

i

N

E

h

3

f

2 (

)

×

×

h

5

f

4 (

)

×

×

h

5

f

4 (

)

×

×

CE 341/441 - Lecture 18 - Fall 2004

p. 18.

  • Notes
    • Each formula and error is for

one

sub-interval with

data/node/integration

points. We can extend the interval to

by summing integrals and errors (error

increases by one order).

  • Sub-interval errors are greater than closed formulae since
    • sub-interval is larger• the error in the interpolation functions tended to be greater near the ends and

especially outside of the interpolating region!

  • Higher order formulae involve large coefficients with +/- signs. This leads to

roundoff problems.

  • Open formulae can be used when functional values are not available at the inte-

grating limits.

N

a b

[

]