0% found this document useful (0 votes)
50 views19 pages

Derivation of Difference Approximations Using Undetermined Coefficients

The document discusses numerical methods for approximating derivatives using difference operators. It defines forward, backward and central difference operators and shows how to derive higher order approximations. It also discusses mixed difference operators and provides examples of applying the operators to compute first and second derivatives.

Uploaded by

acedude16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views19 pages

Derivation of Difference Approximations Using Undetermined Coefficients

The document discusses numerical methods for approximating derivatives using difference operators. It defines forward, backward and central difference operators and shows how to derive higher order approximations. It also discusses mixed difference operators and provides examples of applying the operators to compute first and second derivatives.

Uploaded by

acedude16
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

CE 341/441 - Lecture 12 - Fall 2004

p. 12.1
LECTURE 12
DERIVATIONOF DIFFERENCEAPPROXIMATIONS USINGUNDETERMINED
COEFFICIENTS
All discrete approximations to derivatives are linear combinations of functional values at
the nodes
The total number of nodes used must be at least one greater than the order of differentia-
tion to achieve minimum accuracy .
To obtain better accuracy, you must increase the number of nodes considered.
For central difference approximations to even derivatives, a cancelation of truncation
error terms leads to one order of accuracy improvement
f
i
p ( )
a

+ + +
h
p
------------------------------------------------------------------------ E + =
p O h ( )
CE 341/441 - Lecture 12 - Fall 2004
p. 12.2
Forward second order accurate approximation to the rst derivative
Develop a forward difference formula for which is accurate
First derivative with accuracy the minimum number of nodes is 2
First derivative with accuracy need 3 nodes
The rst forward derivative can therefore be approximated to as:
T.S. expansions about are:
f
i
1 ( )
E O h ( )
2
=
O h ( )
O h ( )
2
i i+1 i+2
O h ( )
2
df
dx
------
x x
i
=
E

1
f
i

2
f
i 1 +

3
f
i 2 +
+ +
h
------------------------------------------------------------------- =
x
i
f
i
f
i
=
f
i 1 +
f
i
h f
i
1 ( ) h
2
2
----- f
i
2 ( ) h
3
6
----- f
i
3 ( )
O h ( )
4
+ + + + =
f
i 2 +
f
i
2h f
i
1 ( )
2h
2
f
i
2 ( ) 4
3
---h
3
f
i
3 ( )
O h ( )
4
+ + + + =
CE 341/441 - Lecture 12 - Fall 2004
p. 12.3
Substituting into our assumed form of and re-arranging
Desire and 2
nd
order accuracy coefcient of must equal unity and coefcients
of and must vanish
f
i
1 ( )

1
f
i

2
f
i 1 +

3
f
i 2 +
+ +
h
------------------------------------------------------------------- =

1

2

3
+ + ( )
h
------------------------------------ f
i

2
2
3
+ ( ) f
i
1 ( )
+

2
2
------ 2
3
+


h f
i
2 ( )
+
1
6
---
2
4
3
---
3
+


h
2
f
i
3 ( )
O h ( )
3
+ +
f
i
1 ( )
f
i
1 ( )
f
i
f
i
2 ( )

1

2

3
+ +
h
------------------------------- 0 =

2
2
3
+ ( ) 1 =

2
2
------ 2
3
+


h 0 =
CE 341/441 - Lecture 12 - Fall 2004
p. 12.4
Solving these simultaneous equations
, ,
Thus the equation now becomes

The forward difference approximation of 2


nd
order accuracy
where

1
3
2
--- =
2
2 =
3
1
2
--- =
3
2
--- f
i
2 f
i 1 +
1
2
-- - f
i 2 +
+
h
---------------------------------------------------------------- 0 ( ) f
i
2 1 ( ) f
i
1 ( )
0 ( ) f
i
2 ( )
+ + =
1
6
-- - 2
4
3
---
1
2
---


h
2
f
i
3 ( )
O h ( )
3
+ +
f
i
1 ( )
3 f
i
4 f
i 1 +
f
i 2 +
+
2h
----------------------------------------------------
1
3
-- -h
2
f
3 ( )
O h ( )
3
+ + =
f
i
1 ( )
3 f
i
4 f
i 1 +
f
i 2 +
+
2h
----------------------------------------------------- E + = E
1
3
-- -h
2
f
i
3 ( )
=
CE 341/441 - Lecture 12 - Fall 2004
p. 12.5
Forward rst order accurate approximation to the second derivative
Derive the forward difference approximations to
Second derivative 3 nodes for accuracy
Develop Taylor series expansions for , and , substitute into expression and
re-arrange:
O h ( ) f
i
2 ( )
O h ( )
f
i
2 ( )
E

1
f
i

2
f
i 1 +

3
f
i 2 +
+ +
h
2
------------------------------------------------------------------- =
f
i
f
i 1 +
f
i 2 +

1
f
i

2
f
i 1 +

3
f
i 2 +
+ +
h
2
------------------------------------------------------------------

1

2

3
+ + ( )
h
2
------------------------------------ f
i
=

2
2
3
+
h
----------------------


f
i
1 ( )
+
1
2
---
2
4
3
+ ( ) f
i
2 ( )
+

2
8
3
+ ( )
h
6
--- f
i
3 ( )
O h ( )
2
+ +
CE 341/441 - Lecture 12 - Fall 2004
p. 12.6
In order to compute we must have:

, ,
Therefore
where
f
i
2 ( )
1
h
2
-----
1

2

3
+ + ( ) 0 =
1
h
---
2
2
3
+ ( ) 0 =
1
2
---
2
4
3
+ ( ) 1 =

1
1 =
2
2 =
3
1 =
f
i
2 ( ) 1
h
2
----- f
i 2 +
2 f
i 1 +
f
i
+ ( ) E + = E h f
i
3 ( )
=
CE 341/441 - Lecture 12 - Fall 2004
p. 12.7
Skewed fourth order accurate approximation to the second derivative
Develop a fourth order accurate approximation to the second derivative at node which
involves nodes , and subsequent nodes to the right of node
requires 3 nodes for accuracy
requires 4 nodes for accuracy
requires 5 nodes for accuracy
requires 6 nodes for accuracy
Therefore we consider nodes
is approximated as:
i
i 1 i i
f
i
2 ( )
O h ( )
O h ( )
2
O h ( )
3
O h ( )
4
i i+1 i+2 i-1 i+3 i+4
f
i
2 ( )
f
i
2 ( )
E

1
f
i 1

2
f
i

3
f
i 1 +

4
f
i 2 +

5
f
i 3 +

6
f
i 4 +
+ + + + +
h
2
--------------------------------------------------------------------------------------------------------------------------------------------------- =
CE 341/441 - Lecture 12 - Fall 2004
p. 12.8
Steps to solve for the unknown coefcients in the linear combination for
Develop Taylor series expansions for , , , ,
Substitute and re-arrange to collect terms on equal derivatives
Generate equations by setting coefcients of to 1 and the remaining 5 leading
coefcients to zero
f
i
2 ( )
f
i 1
f
i 1 +
f
i 2 +
f
i 3 +
f
i 4 +
f
i
2 ( )
CE 341/441 - Lecture 12 - Fall 2004
p. 12.9
NUMERICAL DIFFERENTIATION USING DIFFERENCE OPERATORS
Difference Operators
First order difference operators
Consider the following full and intermediate nodes
First order forward difference operator
First order backward difference operator
First order central difference operator dened using full node functional values
i-1 i i+1 i-1/2 i+1/2
h h
x x
f
i
f
i 1 +
f
i

f
i
f
i
f
i 1

f
i
f
i 1 +
f
i 1

CE 341/441 - Lecture 12 - Fall 2004
p. 12.10
Notes
Intermediate functional values are dened as
First order central difference operator dened using intermediate nodes
The central difference operator is dened at an intermediate node as
The order of the difference operator is related to the number of times that the operator
is applied and not to the order of accuracy
Higher order difference operators simply repeat operation as indicated by the operator
f
i
1
2
--- +
f x
i
h
2
--- +


=
f
i
f
i
1
2
-- - +
f
i
1
2
---

f
i
1
2
-- - +
f
i 1 +
f
i

CE 341/441 - Lecture 12 - Fall 2004
p. 12.11
Second order forward difference operator

2
f
i
f
i
( ) =
f
i 1 +
f
i
( ) =
f
i 1 +
f
i
=
f
i 2 +
f
i 1 +
( ) f
i 1 +
f
i
( ) =

2
f
i
f
i 2 +
2 f
i 1 +
f
i
+ =
CE 341/441 - Lecture 12 - Fall 2004
p. 12.12
Third order backward difference operator

3
f
i

2
f
i
( ) =

2
f
i
f
i 1
( ) =
f
i
f
i 1
( ) =
f
i
f
i 1
( ) f
i 1
f
i 2
( ) [ ] =
f
i
2 f
i 1
f
i 2
+ [ ] =
f
i
2 f
i 1
f
i 2
+ =
f
i
f
i 1
( ) 2 f
i 1
f
i 2
( ) f
i 2
f
i 3
( ) + =

3
f
i
f
i
3 f
i 1
3 f
i 2
f
i 3
+ =
CE 341/441 - Lecture 12 - Fall 2004
p. 12.13
Second order central difference operator

2
f
i
f
i
( ) =
f
i
1
2
--- +
f
i
1
2
-- -



=
f
i
1
2
-- - +
f
i
1
2
---
=
f
i 1 +
f
i
( ) f
i
f
i 1
( ) =

2
f
i
f
i 1 +
2 f
i
f
i 1
+ =
CE 341/441 - Lecture 12 - Fall 2004
p. 12.14
Second order mixed difference operator
We can also apply different operators; e.g.
,
Applying a rst order forward difference operator and then a rst order backward differ-
ence operator
We note that and in general (2m)
th
order central differ-
ence operator

n m

m
1 m n
f
i
f
i
( ) =
f
i
f
i 1
( ) =
f
i
f
i 1
=
f
i 1 +
f
i
( ) f
i
f
i 1
( ) =
f
i
f
i 1 +
2 f
i
f
i 1
+ =

2
= =
2m

m
=
CE 341/441 - Lecture 12 - Fall 2004
p. 12.15
Approximations to Differentiation Using Difference Operators
First order backward difference operator approximation to the rst derivative
df
dx
------
x
i
f
i
x
i
--------
df
dx
------
x
i
f
i
x
i
---------
df
dx
------
x
i
f
i
x
i
--------
f
i
1 ( )
f
i
x
i
---------
i-1 i
x
i
= h
f
i
1 ( )
f
i
f
i 1

h
-----------------------
CE 341/441 - Lecture 12 - Fall 2004
p. 12.16
First order central difference operator approximation to the rst derivative
f
i
1 ( )
f
i
x
i
--------
i-1/2 i i+1/2
h/2 h/2
x
i
= h
f
i
1 ( )
f
i
1
2
--- +
f
i
1
2
---

h
-----------------------------
i-1/2 i i+1/2
h h
x
i
= 2h
f
i
1 ( )
f
i 1 +
f
i 1

2h
------------------------------
CE 341/441 - Lecture 12 - Fall 2004
p. 12.17
Central difference approximation to the rst derivative as an average of rst order for-
ward and backward difference approximations
We note that rst order central difference approximations can also be derived as arith-
metic averages of rst order forward and backward difference approximations
This concept can be generalized to central approximations to higher order derivatives as
well (see the next section)
f
i
1 ( ) 1
2
---
f
i
x
i
--------
f
i
x
i
--------- +
f
i
1 ( ) 1
2
---
f
i 1 +
f
i

h
----------------------
f
i
f
i 1

h
---------------------- +
f
i
1 ( )
f
i 1 +
f
i 1

2h
------------------------------ =
CE 341/441 - Lecture 12 - Fall 2004
p. 12.18
General difference operator approximations to derivatives
In general we can approximate derivatives using
Forward approximations
Backward approximations
Central approximations
even
odd
f
i
p ( )

p
f
i
h
p
------------ O h ( ) +
f
i
p ( )

p
f
i
h
p
------------ O h ( ) +
f
i
p ( )

p
f
i
p
2
--- +

p
f
i
p
2
---
+
2h
p
---------------------------------------------- O h ( )
2
+ p
f
i
p ( )

p
f
i
p 1
2
------------ +

p
f
i
p 1
2
------------
+
2h
p
------------------------------------------------------------ O h ( )
2
+ p
CE 341/441 - Lecture 12 - Fall 2004
p. 12.19
A complete operator approach to central differencing can be developed. However this
approach is somewhat articial and overly complicated.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy