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

Newton Forward Interpolation-Numerical Methods in Engineering-Lecture 7 Slides-Civil Engineering and Geological Sciences, Slides of Numerical Methods in Engineering

Newton Forward Interpolation, Forward Difference Tables, Zeroth Order Forward Difference, First Order Forward Difference, Second Order Forward Difference, Third Order Forward Difference, Kth Order Forward Difference, Newton Forward Interpolation, Newton Backward Interpolation

Typology: Slides

2011/2012

Uploaded on 02/20/2012

damyen
damyen 🇺🇸

4.4

(27)

274 documents

1 / 27

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CE 341/441 - Lecture 7 - Fall 2004
p. 7.1
LECTURE 7
NEWTON FORWARD INTERPOLATION ON EQUISPACED POINTS
Lagrange Interpolation has a number of disadvantages
• The amount of computation required is large
Interpolation for additional values of requires the same amount of effort as the first
value (i.e. no part of the previous calculation can be used)
When the number of interpolation points are changed (increased/decreased), the
results of the previous computations can not be used
• Error estimation is difficult (at least may not be convenient)
Use Newton Interpolation which is based on developing difference tables for a given set
of data points
The degree interpolating polynomial obtained by fitting data points will be
identical to that obtained using Lagrange formulae!
Newton interpolation is simply another technique for obtaining the same interpo-
lating polynomial as was obtained using the Lagrange formulae
x
Nth N1+
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download Newton Forward Interpolation-Numerical Methods in Engineering-Lecture 7 Slides-Civil Engineering and Geological Sciences and more Slides Numerical Methods in Engineering in PDF only on Docsity!

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

LECTURE 7NEWTON FORWARD INTERPOLATION ON EQUISPACED POINTS • Lagrange Interpolation has a number of disadvantages

• The amount of computation required is large• Interpolation for additional values of

requires the same amount of effort as the first

value (i.e. no part of the previous calculation can be used)

• When the number of interpolation points are changed (increased/decreased), the

results of the previous computations can not be used

• Error estimation is difficult (at least may not be convenient)

• Use Newton Interpolation which is based on developing difference tables for a given set

of data points

• The

degree interpolating polynomial obtained by fitting

data points will be

identical to that obtained using Lagrange formulae!

• Newton interpolation is simply

another

technique for obtaining the same interpo-

lating polynomial as was obtained using the Lagrange formulae

x

N

th

N

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

Forward Difference Tables • We assume equi-spaced points (not necessary)• Forward differences are now defined as follows:

(Zero

th^

order forward difference)(First order forward difference)

x^0

f^1

= f(x

f^

f^2

= f(x

f^3

= f(x

f^0

= f(x

fN

= f(x

N^

x^1

x^2

x^3

xN

x

h = interval size

N

(i)

0 f^ i

f^ i

f^

i^

f^ i

1 +^

f^ i

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

• Note that to compute higher order differences in the tables, we take forward differences

of previous order differences instead of using expanded formulae.

• The order of the differences that can be computed depends on how many total data

points,

,^

are available

•^

data points can develop up to

order forward differences

i^ 0 1 2 3 4

f^ i

f^

i^

2

f^ i

3

f^ i

4 f^ i

f^ o

f^

o^

f^^1

f^ o

2 f^ o

f^

1

f^

o

3 f^ o

2

f^^1

2

f^ o

4 f^ o

3 f^^1

3 f^ o

f^^1

f^

1

f^^2

f^^1

2 f^^1

f^

2

f^

1

3 f^^1

2

f^^2

2

f^^1

f^^2

f^

2

f^^3

f^^2

2 f^^2

f^

3

f^

2

f^^3

f^

3

f^^4

f^^3

f^^4

x^ o

x^ N

,^

N

N

th

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

Example 1 •^

Develop a forward difference table for the data given

i^

x^ i

f^ i

f^

i^

2 f^ i

3 f^ i

4 f^ i

5 f^ i

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

Step 1 • The Taylor series expansion for

about

is:

Step 2a • Express first order forward difference in terms of

• However since

, we can use the Taylor series given in

Step 1

to express

in

terms of

and its derivatives:

f^

x ( )

x^ o

f^

x ( )

f^

x^ ( o

)^

x^

x^ o

(^

df ) ----- dx

x^

x^ o

x

x^ o

(^

d

2 f d x

2

x^

x^ o

x

x^ o

(^

d

3 f d x

3

x^

x^ o

O x

x^ o

(^

f^

x ( )

f^ o

x^

x^ o

(^

)^ f

(^1) ( (^) o )^

x

x^ o

(^

f^

(^2) ( (^) o )^

x

x^ o

(^

f^

(^3) ( (^) o )^

O x

x^ o

(^

f^ o

f^ o

(^1) ( )

f^

o^

f^^1

f^ o

f^^1

f^

x ( 1

f^^1

f^ o f ^1

f^ o

x^1

x^ o

(^

)^

f^ o

(^1) ( )

x

1

x^ o

(^

f^

(^2) ( (^) o )^

x^1

x^ o

(^

f^

(^3) ( (^) o )^

O x

1

x^ o

(^

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

• We note that the spacing between data points is

• Now, substitute in for

into the definition of the first order forward differences

• Note that the first order forward difference divided by

is in fact an approximation to

the first derivative to

. However, we will use all the terms given in this sequence.

h^

x^1

x^ o

f^^1

f^ o

h f

(^1) ( (^) o )^

h 2 f^ o

(^2) ( )

h 3 f^ o

(^3) ( )

O h

(^

f^^1

f^

o^

f^ o

h f

(^1) ( (^) o )^

h 2 f^ o

(^2) ( )

h 3 f^ o

(^3) ( )

O h

(^

f^ o

f^ o

(^1) ( )

f^

o h


–^

h f

(^2) ( (^) o )^

(^2) h f^

(^3) ( (^) o )^

O h

(^

h

O h

(^

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

• Now substitute in for

and

into the definition of the second order forward difference

operator

• Note that the second order forward difference divided by

is in fact an approximation

to

to

. However, we will use all terms in the expression.

f^^2

f^^1

2

f^ o

f^ o

h f

(^1) ( (^) o )^

h 2 f^ o

(^2) ( )

(^3) h f^

(^3) ( (^) o )^

O h

(^

f^ o

-^

h f

(^1) ( (^) o )^

(^2) h f^

(^2) ( (^) o )^

h 3 f^ o

(^3) ( )

O h

(^

f^ o

f^ o

(^2) ( )

2 f^ o h 2


-^

h f

(^3) ( (^) o )^

O h

(^

h 2

f^ o

(^2) ( )

O h

(^

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

Step 2c • Express the third order forward difference in terms of• We already developed expressions for

and

• Develop an expression for

using the T.S. in

Step 1

• Noting that

f^ o

f^ o

(^1) ( )

3 f^ o

f^^3

f^^2

f^^1

–^

f^ o

f^^2

f^^1

f^^3

f^

x ( 3

f^^3

f^ o

x^3

x^ o

(^

)^

f^ o

(^1) ( )

x

3

x^ o

(^

f^

(^2) ( (^) o )^

x^3

x^ o

(^

f^

(^3) ( (^) o )^

O x

3

x^ o

(^

x^3

x^ o

-^

h

f^^3

f^ o

h f

(^1) ( (^) o )^

(^2) h f^

(^2) ( (^) o )^

h 3 f^ o

(^3) ( )

O h

(^

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

Step 3a • Consider the general T.S. expansion presented in

Step 1

to define

and substitute in

for

using the result in

Step 2a.

• Note that now we are

not

evaluating the T.S. at a data point but at any

f^

x ( )

f^ o

(^1) ( )

x

f^

x ( )

f^ o

x^

x^ o

(^

f^

o h


h f

(^2) ( (^) o )^

h 2 f^ o

(^3) ( )

O h

(^

x

x^ o

(^

f^

(^2) ( (^) o )^

x^

x^ o

(^

f^

(^3) ( (^) o )^

O x

x^ o

(^

f^

x ( )

f^ o

x^

x^ o

-^ h -------------

f^

o

x^

x^ o

(^

) h

–^

x^

x^ o

(^

[^

]^ f

(^2) ( (^) o )

x^

x^ o

(^

) h

2

–^

x^

x^ o

(^

[^

]^ f

(^3) ( (^) o )^

O h

(^

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

Step 3b • Substitute in for

using the expression developed in

Step 2b

f^ o

(^2) ( )

f^

x ( )

f^ o

x^

x^ o

-^ h -------------

f^

o

x^

x^ o

(^

) h

–^

x^

x^ o

(^

[^

]

2 f^ o h 2


-^

h f

(^3) ( (^) o )^

O h

(^

x^

x^ o

(^

–^

h 2

x^

x^ o

(^

[^

]^

f^ o

(^3) ( )

O h

(^

f^

x ( )

f^ o

x^

x^ o

-^ h -------------

f^

o

x^

x^ o

(^

h

–^

x^

x^ o

(^

(^2) h


2 f^ o

x

x^ o

(^

) h

2

x^

x^ o

(^

x^

x^ o

(^

h

[^

]

f^ o

(^3) ( )

O h

(^

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

• Also considering higher order terms

and

noting that

and

• This is the

degree polynomial approximation to

data points and is iden-

tical to that derived for Lagrange interpolation or Power series (only the form inwhich it is presented is different).

f^

x ( )

f^ o

x^

x^ o

(^

f^

o h


x^

x^ o

(^

)^

x^

x^ o

h

(^

[^

∆]

2 f^ o (^2) h


x

x^ o

(^

)^

x^

x^ o

h

(^

(^

)^

x^

x^ o

h

(^

(^

[^

∆]

3 f^ o (^3) h


-^

O h

(^

HOT

x^ o

h

x^1

x^ o

h

x^2

f^

x (

)^

g x

(^

)^

e x (

g x

(^

)^

f^ o

x^

x^ o

(^

f o h ---------

-^

x

x^ o

(^

)^

x^

x 1

(^

2 f^ o h 2 -----------

x

x^ o

(^

)^

x^

x^1

(^

)^

x^

x^2

(^

3

f^ o h

3 -----------

1 ------ N!

x^

x^ o

(^

)^

x^

x^1

(^

)^

x^

x 2

(^

x^

x^ N

1

(^

N^

f^ o h

N -------------

N

th

N

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

• Note that the

data point are

exactly

fit by

⇒ ⇒

• In general

N

g x

(^

g x

o (^

)^

f^ o

g x

1 (^

)^

f^ o

x^1

x^ o

(^

)^

f^^1

f^ o

  • h

f^ o

h^

f^^1

f^ o

  • h ----------------- 

^

f^^1

g x

2 (^

)^

f^ o

x^2

x^ o

(^

)^

f^^1

f^ o

  • h ----------------- 

^

^

1 ---^2

x^2

x^ o

(^

)^

x^2

x^1

(^

)^

(^1) -----^2 h

f^^2

f^^1

f^ o

(^

g x

2 (^

)^

f^ o

2 h ----- h

-^

f^^1

f^ o

(^

)^

h (^

) h 2 h 2


-^

f^^2

f^^1

f^ o

(^

g x

2 (^

)^

f^ o

f^^1

f^ o

-^

f^^2

f^^1

-^

f^ o

f^^2

g x

i (^

)^

f^ i =

i^

N ,

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

• Thus the error can be estimated as• Notes

• Approximation for

is equal to the term that would follow the last term in the

degree polynomial series for

• If we have

data points available and develop an

degree polynomial approx-

imation with

data points, we can then easily estimate

. This was not as

simple for Lagrange polynomials since you then needed to compute the finite differ-ence approximation to the derivative in the error function.

• If the exact function

is a polynomial of degree

, then

will be an

(almost) exact representation of

(with small roundoff errors).

• Newton Interpolation is much more efficient to implement than Lagrange Interpola-

tion. If you develop a difference table

once

,^

you can

• Develop various order interpolation functions very quickly (since each higher

order term only involves one more product)

• Obtain error estimates very quickly

e x (

)^

x^

x^ o

(^

)^

x^

x 1

(^

x

x^ N

(^

N

(^

-^

N^

1 +^

f^ o

h

N

1 +

--------------------

e x (

N

th

g x

(^

N

N

th

N

e x (

f^

x (

)^

M

N

g x

(^

f^

x ( )

CE 341/441 - Lecture 7 - Fall 2004

p. 7.

Example 2 •^

For the data and forward difference table presented in

Example 1

•^

(a)

Develop

using 3 points (

,^

and

) and estimate

•^

(b)

Develop

using 4 points (

,^

,^

,^

) and estimate

•^

(c)

Develop

using 3 different points (

,^

,^

(Part a) • 3 data points

with

and

• Note that the “3” designation in

indicates

N+1=

data points

g x

(^

)^

x^ o

x^1

x^2

e x (

g x

(^

)^

x^ o

x^1

x^2

x^3

e x (

g x

(^

)^

x^ o

x^1

x^2

N

g 3

x ( )

f^ o

x^

x^ o

(^

f^

o h


x

x^ o

(^

)^

x^

x^1

(^

2 f^ o (^2) h


x^ o

x^1

x^2

h^

g 3

x ( )