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 Differentiation-Numerical Methods in Engineering-Lecture 13 Slides-Civil Engineering and Geological Sciences, Slides of Numerical Methods in Engineering

Difference formulae can be developed such that linear combinations of functional values at various nodes approximate a derivative at a node. Numerical Differentiation, Interpolating Polynomials, Formulae, Finite Difference, Quadratic Interpolating Polynomial, Error Estimates, Power Series

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 13 - Fall 2004
p. 13.1
LECTURE 13
NUMERICAL DIFFERENTIATION FORMULAE BY INTERPOLATING POLY-
NOMIALS
Relationship Between Polynomials and Finite Difference Derivative Approximations
We noted that Nth degree accurate Finite Difference (FD) expressions for first derivatives
have an associated error
•Iff(x) is an Nth degree polynomial then,
and the FD approximation to the first derivative is exact!
Thus if we know that a FD approximation to a polynomial function is exact, we can
derive the form of that polynomial by integrating the previous equation.
Eh
NdN1+ f
dxN1+
-----------------
dN1+ f
dxN1+
------------------0=
fx() a1xNa2xN1aN1+
+++
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 Numerical Differentiation-Numerical Methods in Engineering-Lecture 13 Slides-Civil Engineering and Geological Sciences and more Slides Numerical Methods in Engineering in PDF only on Docsity!

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

LECTURE 13NUMERICAL DIFFERENTIATION FORMULAE BY INTERPOLATING POLY-NOMIALSRelationship Between Polynomials and Finite Difference Derivative Approximations • We noted that

N

th^

degree accurate Finite Difference (FD) expressions for first derivatives

have an associated error

• If

f(x)

is an

N

th

degree polynomial then,

and the FD approximation to the first derivative is exact!

• Thus if we know that a FD approximation to a polynomial function is exact, we can

derive the form of that polynomial by integrating the previous equation.

E

h^ N^

d^ N^

1 +^

f

d x

N

1


d^ N

1 +^

f

d x

N

1 +

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

-^

f^

x (

)^

a^1

x N

a

x 2 N

1

-^

a^ N

1 +

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• This implies that a distinct relationship exists between polynomials and FD expressions

for derivatives (different relationships for higher order derivatives).

• We can in fact develop FD approximations from interpolating polynomials Developing Finite Difference Formulae by Differentiating Interpolating Polynomials Concept • The approximation for the

derivative of some function

can be found by

taking the

derivative of a polynomial approximation,

, of the function

Procedure • Establish a polynomial approximation

of degree

such that

•^

is forced to be exactly equal to the functional value at

data points or nodes

• The

derivative of the polynomial

is an approximation to the

derivative of

p^ th

f^

x (

th p

g x

(^

f^

x (

g x

(^

)^

N

N

p

g x

(^

)^

N

th p

g x

(^

)^

thp

f^

x ( )

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

Develop a quadratic interpolating polynomial • We apply the

Power Series

method to derive the appropriate interpolating polynomial

• Alternatively we could use either

Lagrange basis functions

or

Newton forward or

backward interpolation

approaches in order to establish the interpolating polyno-

mial

• The 3 node quadratic interpolating polynomial has the form• The approximating Lagrange polynomial

must

match the functional values at all

data points or nodes (

,^

,^

⇒ ⇒ ⇒

g x

(^

)^

a^

xo 2

a

x 1

a 2

N

x^ o

x^1

h

x^2

h

g x

o (^

)^

f^ o

a^ o

2

a^1

a 2

f^ o

g x

1 (^

)^

f^^1

a^

ho 2

a^1

h^

a 2

f^^1

g x

2 (^

)^

f^^2

a^ o^

h (^

a 1

h (^

)^

a^2

f^^2

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• Setting up the constraints as a system of simultaneous equations• Solve for

,^

,^

• The interpolating polynomial and its derivative are equal to:

(^2) h

h^

h 2

h^

a^ o a 1 a 2

f^ o f^^1 f^^2

a^ o^

a^1

a (^2) a^ o

f^^2

f^^1

-^

f^ o

2

(^2) h

a 1

f^^1

f^^2

-^

f^ o

  • 2 h

a 2

f^ o

g x

(^

)^

f^^2

f^^1

-^

f^ o +

2 h 2

-^

(^2) x

f^^1

f^^2

-^

f^ o

  • 2 h

-^

x^

f^ o

g^

(^1) ( )

x (^

)^

f^^2

f^^1

-^

f^ o + h 2

-^

x^

f^^1

f^^2

-^

f^ o

  • 2

h

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• Generalize the node numbering for the approximation• This results in the generic 3 node forward difference approximation to the first derivative

at node

i

i^

i+

i+

generalized nodal numbering

x^0

x^1

x^2

f^ i

(^1) ( )

f^ i

-^

f^ i

1 +^

f^ i

2 +

h

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

Evaluating

( g 1) ( x

) 1

to obtain a central difference approximation to the first derivative

• Evaluating the derivative of the interpolating function at

• Again since the function

is approximated by the interpolating function

• Substituting in for the expression for

x^1

h

g^

(^1) ( )

x

1 (^

)^

g^

(^1) ( )

h (^

g^

(^1) ( )

x

1 (^

)^

f^^2

f^^1

-^

f^ o

(^

h 2

  • h

f^^1

f^^2

f^ o

h

g^

(^1) ( )

x

1 (^

)^

f^^2

f^ o

  • 2 h

    = f x (^

)^

g x

(^

f^

(^1) ( )

x^1

g^

(^1) ( )

x

1 (^

g^

(^1) ( )

x

1 (^

f^

(^1) ( )

x^1

f^^2

f^ o

  • 2 h

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

Evaluating

( g 1) ( x

) 2

to obtain a backward difference approximation to the first derivative

• Evaluating the derivative of the interpolating function at

• Again since the function

is approximated by the interpolating function

• Substituting in for the expression for

x^2

h

g^

(^1) ( )

x

2 (^

)^

g^

(^1) ( )

h (^

g^

(^1) ( )

x

2 (^

)^

f^^2

f^^1

-^

f^ o

(^

h 2

h^

f^^1

f^^2

f^ o

h

g^

(^1) ( )

x

2 (^

)^

f^^2

f^^1

-^

f^ o

2 h

= f x (^

)^

g x

(^

f^

(^1) ( )

x^2

g^

(^1) ( )

x

2 (^

g^

(^1) ( )

x

2 (^

f^

(^1) ( )

x^2

f^^2

f^^1

-^

f^ o

2 h

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• Generalizing the node numbering• This results in the generic expression for a three node backward difference approxima-

tion to the first derivative

x^0

x^1 i-

x^2 i

i-2^ f^ i

(^1) ( )

f^ i

f^ i

1

–^

f^ i

2

+

2

h

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• Substituting in for the expression for• Generalizing the node numbering• This results in the generic expression for a three node forward difference approximation

to the second derivative

g^

(^2) ( )

x

o (^

f^

(^2) ( )

x^ o

f^^2

f^^1

-^

f^ o

h 2

i+2^ x^2

i+1x^1

i x^0 f^ i (^2) ( )

f^ i

2 +^

f^ i

1 +

–^

f^ i +

h

2

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

Evaluating

( g 2) ( x

) 1

to obtain a central difference approximation to the second derivative

• Evaluating the second derivative of the interpolating function at

• Again since the function

is approximated by the interpolating function

, the

second derivative at node

x

1

is approximated as:

• Substituting in for the expression for

x^1

h

g^

(^2) ( )

x

1 (^

)^

g^

(^2) ( )

h (^

g^

(^2) ( )

x

1 (^

)^

f^^2

f^^1

-^

f^ o

h 2

=^ f^

x (

)^

g x

(^

f^

(^2) ( )

x^1

g^

(^2) ( )

x

1 (^

g^

(^2) ( )

x

1 (^

f^

(^2) ( )

x^1

f^^2

f^^1

-^

f^ o

h 2

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

Approximations and Associated Error Estimates to First and Second Derivatives Us-ing Quadratic Interpolation • We can derive an error estimate when using interpolating polynomials to establish

finite difference formulae by simply differentiating the error estimate associated withthe interpolating function.

• We will illustrate the use of a 3 node Newton forward interpolation formula to derive:

• A central approximation to the first derivative with its associated error estimate• A forward approximation to the second derivative with its associated error estimate

Developing a 3 node interpolating function using Newton forward interpolation • A quadratic interpolating polynomial (

) has 3 associated nodes (

) or

interpolating points. We again assume that the nodes are evenly distributed as:

• With a quadratic interpolating polynomial, we can derive differentiation formulae for

both the first and second derivatives but no higher

N

N

x^0

x^1

x^2

f^0

f^1

f^2

h^

h

x

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• The approximating or interpolating function is defined using Newton forward interpola-

tion as:

• The error can be approximately expressed in either of the following forms:• These latter two forms which do not involve

are more suitable for the necessary differ-

entiation w.r.t.

x

since

is functionally dependent on

x

, i.e.

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 (^2) h


e x (

)^

x^

x^ o

(^

)^

x^

x^1

(^

)^

x^

x^2

(^

f

(^3) ( (^) )^

ξ(

x^ o

ξ^

x^2

e x (

)^

x^

x^ o

(^

)^

x^

x^1

(^

)^

x^

x^2

(^

f o

(^3) ( )

e x (

)^

x^

x^ o

(^

)^

x^

x^1

(^

)^

x^

x^2

(^

3 f^ o h 3


ξ

ξ^

ξ^

ξ^

x ( )

=

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• Evaluating

in the previous expression

g^

(^1) ( )

x (^

f^

(^1) ( )

x^

x^1

f^

o h


x

x^ o

(^

2 f^ o (^2) h


-^

x^

x^1

(^

2 f^ o (^2) h


-^

e^

(^1) ( )

x (^

x^

x^1

f^

(^1) ( )

x^

x^1

f^

o h


x

1

x^ o

(^

2 f^ o h 2


-^

e^

(^1) ( )

x

1 (^

f^

(^1) ( )

x^

x^1

f^^1

f^ o

  • h

1 ---^2

h -----^2 h

f^^2

f^^1

-^

f^ o

(^

)^

e^

(^1) ( )

x

1 (^

f^

(^1) ( )

x^

x^1

f^^2

f^ o

  • 2 h

e^

(^1) ( )

x

1 (^

CE 341/441 - Lecture 13 - Fall 2004

p. 13.

• Now evaluate

using a non

dependent expression for the error term and evalu-

ating this expression at

• Substituting for

results in:

e^

(^1) ( )

x (^

)^

ξ

x^1

e^

(^1) ( )

x

1 (^

)^

f

(^3) ( (^) )^

x^ ( o

)^

x^

x^1

(^

)^

x^

x^2

(^

)^

x^

x^ o

(^

)^

x^

x^2

(^

)^

x^

x^ o

(^

)^

x^

x^1

(^

[^

] x

x^1

e^

(^1) ( )

x

1 (^

)^

f

(^3) ( (^) )^

x^ ( o

)^

x^1

x^ o

(^

)^

x^1

x^2

(^

e^

(^1) ( )

x

1 (^

)^

h

-^

f^

(^3) ( )

x

o (^

e^

(^1) ( )

x

1 (^

f^

(^1) ( )

x^

x^1

f^^2

f^ o

  • 2 h

h

-^

f^

(^3) ( )

x

o (^