Numerical Differentiation
Numerical Computational Laboratory| CE19004 Lecture:08
Learning Objectives
• To apply different techniques adopted to find differentiation
of a nonlinear function
• To utilize difference tables and apply difference polynomials
for differentiation
Introduction
x y = f(x)
3.2 0.04076
3.5 0.0302
3.8 0.02237
4.1 0.01657
4.4 0.01228
5 0.00674
5.3 0.00499
5.6 0.0037
5.9 0.00274
6.2 0.00203
6.5 0.0015
The functional values f(x) are known - f(x) = e-x
Exact form of differentiation
Introduction
x y = f(x)
3.2 0.04076
3.5 0.0302
3.8 0.02237
4.1 0.01657
4.4 0.01228
5 0.00674
5.3 0.00499
5.6 0.0037
5.9 0.00274
6.2 0.00203
6.5 0.0015
f(x) = e-x
To determine f’(x) at x = 4.8
dy/dx = f’(x) = -e-x
In case the exact form of function f(x) is known
Introduction
For differentiation of the discrete data
- approx. numerical procedure to find differentiation at discrete points
- fitting approximate functions Pn(x) (polynomials) - differentiate
d
dx
( f ( ))
x
d
dx
( Pn ( x ) )
1. Direct fit polynomials
2. Lagrange polynomials
3. Divided difference polynomials
Applied to equally/unequally spaced data
Even if Pn(x) passes through all
the points, P’n(x) is inaccurate
at know data points
Source: Hoffman, J. D., & Frankel, S. (2018). Numerical methods for engineers and scientists. CRC press.
Differentiation
Direct fit polynomials
Differentiation
Lagrange polynomials
Differentiation
Divided difference
polynomials
Differentiation
Difference Tables and Difference Polynomials
An arrangement of a set of data [x, f(x)], in a table with x values in
monotonic ascending order
- With additional columns composed of differences of the numbers
in the preceding column
Equally spaced data
Difference Tables and Difference Polynomials
An arrangement of a set of data [x, f(x)], in a table with x values in
monotonic ascending order
- With additional columns composed of differences of the numbers
in the preceding column
Equally spaced data
Difference Tables and Difference Polynomials
An arrangement of a set of data [x, f(x)], in a table with x values in
monotonic ascending order
- With additional columns composed of differences of the numbers
in the preceding column
Equally spaced data
Type of difference polynomials
Forward difference relative to point i
Newton’s Forward Difference
Polynomial
Source: Hoffman, J. D., & Frankel, S. (2018). Numerical methods for engineers and scientists. CRC press.
Type of difference polynomials
Backward difference relative to point i+1
Newton’s Backward Difference
Polynomial
Source: Hoffman, J. D., & Frankel, S. (2018). Numerical methods for engineers and scientists. CRC press.
Other difference polynomials
Centered difference relative to point i+1/2
Sterling’s Centered Difference
Polynomial
Source: Hoffman, J. D., & Frankel, S. (2018). Numerical methods for engineers and scientists. CRC press.
Differentiation of difference polynomials
Forward difference
dd
dx
dx
((ff((xx)) ) ((PPnn((xx)) )
dd
dx
dx
ds 1
=
dx h
= Pn ( x ) = ( Pn ( s ) )
' d ds Pn' ( x ) =
1 d
h ds
( Pn ( s ) )
ds dx
First order derivative
Estimation of error
Differentiating the error term
At x = x0, s = 0
Differentiation of difference polynomials
Backward difference
First order derivative
Difference formulas
Expressed in terms of function values
At x = x0, s = 0
Taylor Series approach
Continuous spatial domain D(x) is discretized into an equally
space grid of discrete points
Difference formulas
Continuous temporal domain D(t)
Finite Difference
approximations
Source: Hoffman, J. D., & Frankel, S. (2018). Numerical methods for engineers and scientists. CRC press.
Thank you