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

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

In numerical methods, like tables, the values of the function are only specified at a discrete number of points! Using interpolation, we can describe or at least approximate the function at every point in space. Interpolation, Linear Interpolation, Error, Interpolating Functions, Exponential Function, Nth Order Polynomial, Data Points, Nodes, Interpolation Points

Typology: Slides

2011/2012

Uploaded on 02/20/2012

damyen
damyen 🇺🇸

4.4

(27)

274 documents

1 / 15

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CE 341/441 - Lecture 5 -Fall 2004
p. 5.1
LECTURE 5
INTRODUCTION TO INTERPOLATION
Interpolation function: a function that passes exactly through a set of data points.
Interpolating functions to interpolate values in tables
In tables, the function is only specified at a limited number or discrete set of indepen-
dent variable values (as opposed to a continuum function).
We can use interpolation to find functional values at other values of the independent
variable, e.g. sin(0.63253)
xsin(x)
0.0 0.000000
0.5 0.479426
1.0 0.841471
1.5 0.997495
2.0 0.909297
2.5 0.598472
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

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

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

LECTURE 5INTRODUCTION TO INTERPOLATION • Interpolation function: a function that passes exactly through a set of data points. • Interpolating functions to interpolate values in tables

• In tables, the function is only specified at a limited number or discrete set of indepen-

dent variable values (as opposed to a continuum function).

• We can use interpolation to find functional values at other values of the independent

variable, e.g. sin(0.63253)

x^

sin(

x )

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

• In numerical methods, like tables, the values of the function are only specified at a

discrete number of points! Using interpolation, we can describe or at least approximatethe function at every point in space.

• For numerical methods, we use interpolation to

• Interpolate values from computations• Develop numerical integration schemes• Develop numerical differentiation schemes• Develop finite element methods

• Interpolation is typically not used to obtain a functional description of measured data

since errors in the data may lead to a poor representation.

• Curve fitting to data is handled with a separate set of techniques

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

• If

is a linear function then

(1)

where

and

are unknown coefficients

• To pass through points

and

we must have:

(2)

(3)

• 2 unknowns and 2 equations

solve for

• Using (2)

Substituting into (3)

g x

(^

g x

(^

)^

Ax

B

A

B

x^ o

f^

x^ ( o

(^

)^

x^1

f^

x ( 1

(^

g x

o (^

)^

f^

x^ ( o

Ax

o^

B

f^

x^ ( o

g x

1 (^

)^

f^

x ( 1

Ax

1

B

f^

x ( 1

A B

B

f^

x^ ( o

)^

Ax

o

A

x^1

f^

x^ ( o

)^

Ax

o

f^

x ( 1

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

• Substituting for

and

into equation (1)

This is the formula for linear interpolation

A

f^

x ( 1

)^

f^

x^ ( o

x^1

x^ o

B

f^

x^ ( o

) x

1

f^

x ( 1

) x

o

x^1

x^ o

A

B^ g x

(^

)^

f^

x^ o (^

)^

x 1

x

(^

x 1

x^ o

(^

-^

f^

x (^1

)^

x^

x^ o

(^

x 1

x^ o

(^

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

Error for Linear Interpolating Functions • Error is defined as:•^

represents the difference between the exact function

and the interpolating or

approximating function

• We note that at the interpolating points

and

• This is because at the interpolating point we have by definition

e x (

)^

f^

x (

)^

g x

(^

e x (

)^

f^

x ( )

g x

(^

x^ o

x^1

e x

o (^

)^

e x

1 (^

)^

g x

o (^

)^

f^

x^ ( o

g x

1 (^

)^

f^

x ( 1

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

Derivation of

e(x)

Step 1 • Expand

in Taylor Series (T.S.) about

where

(4)

• The third term is the actual remainder term and represents all other terms in the series

since

it is evaluated at

x

f(x

f(x

x^0

x^1

f(x)

g(x)

f(x)

e x (

)^

f^

x (

)^

g x

(^

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^

ξ

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

Step 3 • Substitute Equation 7 into T.S. form of

, Equation (4).

• This gives us an expression for

in terms of the discrete values

and

(8)

(9)

(10)

(11)

f^

x ( )

f^

x (

)^

f^

x^ ( o

)^

f^

x ( 1

f^

x ( )

f^

x^ ( o

)^

x^

x^ o

(^

f^

x ( 1

x^1

x^ o

(^

-^

f^

x^ ( o

x^1

x^ o

(^

–^

x^1

x^ o

(^

d - 2 f d x

2

x^

ξ

–^

x^

x^ o

(^

d - 2 f d x

2

x^

ξ

f^

x ( )

f^

x^ ( o

)^

x^

x^ o

(^

x^1

x^ o

(^

-^

f^

x ( 1

)^

x^

x^ o

(^

x^1

x^ o

(^

-^

f^

x^ ( o

–^

x^

x^ o

(^

)^

x

-^

1

x^ o

(^

-^

x^

x^ o

(^

d 2 f d x

2

x^

ξ

f^

x ( )

x^1

x^ o

-^

x

-^

x^ o

(^

)^

f^

x^ ( o

x^1

x^ o

(^

-^

x^

x^ o

(^

)^

f^

x ( 1

x^1

x^ o

(^

-^

x^1

-^

x^ o

x^

x^ o

(^

)^

x^

x^ o

(^

d - 2 f d x

2

x^

ξ

f^

x (

)^

f^

x^ ( o

)^

x 1

x

  • x 1

x^ o

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

-^

f^

x (^1

)^

x^

x^ o

  • x 1

x^ o

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

-^

x^

x^ o

(^

)^

x^

x 1

(^

d - 2 f d x

2 --------

x^

ξ =

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

• The first part of Equation (11) is simply the linear interpolation formula. The second

part is in fact the error. Thus:

⇒ ⇒

• If we assume that the interval

is small, then the second derivative won’t change

dramatically in the interval!

where

e x (

)^

f^

x ( )

g x

(^

e x (

)^

f^

x^ ( o

)^

x^1

x

  • x^1

x^ o


-^

f^

x ( 1

)^

x^

x^ o

  • x^1

x^ o


-^

x^

x^ o

(^

)^

x^

x^1

(^

d -

2 f d x

2

x^

ξ

f^

x^ ( o

–^

x^1

x

  • x^1

x^ o


-^

f^

x ( 1

–^

x^

x^ o

  • x^1

x^ o


e x (

)^

x^

x^ o

(^

)^

x^

x 1

(^

d - 2

f d x

2 --------

x^

ξ =

x^ o^

ξ^

x 1

x^ o

x^1 , [^

]

d 2 f d x

2

x^

ξ

d 2 f d x

2

x^

x^ o

d 2

f d x

2

x^

x^1

d 2

f d x

2

x^

x^ m

x^ m

x^ o

x^1 +^2


CE 341/441 - Lecture 5 -Fall 2004

p. 5.

• Thus • Notes on Error for linear interpolation

• The error expression has a polynomial and a derivative portion.• Maximum error occurs approximately at the midpoint between

and

• Error increases as the interval

increases

• Error increases as

increases. Again note that

can be approximated

with finite difference (F.D.) formulae if at least 3 surrounding functional values areavailable. (We will discuss F.D. formulae later.)

max

e x

(^

)^

x^0

x^

x^1

<^

<

h

d 2 f d x

2 --------

x^ m

x^ o^

x^1

h

f^

(^2) ( )

x (

)^

f^

(^2) ( )

x (

CE 341/441 - Lecture 5 -Fall 2004

p. 5.

Example 2 • Compute an error estimate for the problem in Example 1.• Recall we found that• Error is estimated as:• Since

is the midpoint at the interval

, we have

g^

)^

e x (

)^

1 ---^2

x^

x^ o

(^

)^

x^

x^1

(^

d ) 2 f d x

2

x^

x^ m

x^

[^

]

e^

)^

(^

)^

(^

d ) 2

f d x

2

x^

=

e^

)^

d 2 f d x

2

x^

=