0% found this document useful (0 votes)
74 views13 pages

Chapter 6 High Accuracy Differentiation

1) This document discusses methods for numerically calculating derivatives of functions using finite difference formulas with equally spaced data points. 2) The forward, backward, and centered finite difference formulas are presented for calculating the first and second derivatives to high accuracy with either 1st or 2nd order methods. 3) To calculate the derivative at a point, the document instructs labeling the given data points around that value and choosing the appropriate finite difference formula based on the type of derivative and order desired, then solving the formula.

Uploaded by

Ali Khatib
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)
74 views13 pages

Chapter 6 High Accuracy Differentiation

1) This document discusses methods for numerically calculating derivatives of functions using finite difference formulas with equally spaced data points. 2) The forward, backward, and centered finite difference formulas are presented for calculating the first and second derivatives to high accuracy with either 1st or 2nd order methods. 3) To calculate the derivative at a point, the document instructs labeling the given data points around that value and choosing the appropriate finite difference formula based on the type of derivative and order desired, then solving the formula.

Uploaded by

Ali Khatib
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/ 13

High Accuracy

Differentiation

Equally-spaced data differentiation

1
Must be
equally-spaced data

h=1 h=1 h=1


𝒙 1 2 3 4
𝒇 𝒙 10 13 14 21

High accuracy differentiation 2


Can be used for
a) Differentiation of tabulated data
Example:

𝑥 𝑓(𝑥)
1 10 Calculate 𝑓′(2)
2 12
3 14
High accuracy differentiation 3
b) Differentiation of function
Example:
𝑓 𝑥 = 0.2 + 25𝑥 − 2𝑥 2
Calculate 𝑓′ 1 = ?

Generate data using function


𝑥 0 1 2
𝑓 𝑥 0.2 23.2 42.2
High accuracy differentiation 4
List of formulas
1) Forward finite-divided-difference
a) First derivative
Formula:
𝑓 𝑥𝑖+1 −𝑓(𝑥𝑖 )
𝑓′ 𝑥𝑖 = (1st order)

Step size

−𝑓 𝑥𝑖+2 +4𝑓 𝑥𝑖+1 −3𝑓(𝑥𝑖 )


𝑓′ 𝑥𝑖 = (2nd order)
2ℎ
Forward finite-divided-difference 5
(b) Second derivative
Formula:
𝑓 𝑥𝑖+2 −2𝑓 𝑥𝑖+1 +𝑓(𝑥𝑖 )
𝑓′′ 𝑥𝑖 = (1st order)
ℎ2

−𝑓 𝑥𝑖+3 +4𝑓 𝑥𝑖+2 −5𝑓 𝑥𝑖+1 +2𝑓(𝑥𝑖 )


𝑓′′ 𝑥𝑖 = (2nd order)
ℎ2

Forward finite-divided-difference 6
2) Backward finite-divided-difference
(a) First derivative
Formula:
𝑓 𝑥𝑖 −𝑓(𝑥𝑖−1 )
𝑓′ 𝑥𝑖 = (1st order)

3𝑓 𝑥𝑖 −4𝑓 𝑥𝑖−1 +𝑓(𝑥𝑖−2 )


𝑓′ 𝑥𝑖 = (2nd order)
2ℎ
Backward finite-divided-difference 7
(b) Second derivatives
Formula:
𝑓 𝑥𝑖 −2𝑓 𝑥𝑖−1 +𝑓(𝑥𝑖−2 )
𝑓′′ 𝑥𝑖 = (1st order)
ℎ2

2𝑓 𝑥𝑖 −5𝑓 𝑥𝑖−1 +4𝑓 𝑥𝑖−2 −𝑓(𝑥𝑖−3 )


𝑓′′ 𝑥𝑖 = (2nd order)
ℎ2

Backward finite-divided-difference 8
3) Centered finite-divided-difference
(a) First derivative
Formula:
𝑓 𝑥𝑖+1 −𝑓(𝑥𝑖−1 )
𝑓′ 𝑥𝑖 = (1st order)
2ℎ

−𝑓 𝑥𝑖+2 +8𝑓 𝑥𝑖+1 −8𝑓 𝑥𝑖−1 +𝑓(𝑥𝑖−2 )


𝑓′ 𝑥𝑖 = (2nd order)
12ℎ
Centered finite-divided-difference 9
(b) Second derivative
Formula:
𝑓 𝑥𝑖+1 −2𝑓 𝑥𝑖 +𝑓(𝑥𝑖−1 )
𝑓′′ 𝑥𝑖 = (1st order)
ℎ2

−𝑓 𝑥𝑖+2 +16𝑓 𝑥𝑖+1 −30𝑓 𝑥𝑖 +16𝑓 𝑥𝑖−1 −𝑓(𝑥𝑖−2 )


𝑓′′ 𝑥𝑖 =
12ℎ
(2nd order)

Centered finite-divided-difference 10
How to choose data?
Example:
Given data
𝑥 1 2 3 4 5
𝑓 𝑥 15 17 20 21 26

Calculate 𝑓′ 2 = ?

Equally-spaced data differentiation 11


The solution steps
Step 1: Lable the data
𝑥𝑖 = 2 𝑓 𝑥𝑖 = 17
𝑥𝑖+1 = 3 𝑓 𝑥𝑖+1 = 20
𝑥𝑖+2 = 4 𝑓 𝑥𝑖+2 = 21
𝑥𝑖+3 = 5 𝑓 𝑥𝑖+3 = 26
𝑥𝑖−1 = 1 𝑓 𝑥𝑖+1 = 15

Equally-spaced data differentiation 12


Step 2: Choose the right formula
 choose Centered finite-divided-difference
Why?
 choose First derivative, 2nd order
Why?

Step 3: Solve

Equally-spaced data differentiation 13

You might also like