Anda di halaman 1dari 20

Mathematical Models for Engineering Problems and Dierential Equations

fall, 2010 University of Seoul School of Computer Science Minho Kim

Table of contents
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Background

Dierentiation rate of change of a quantity When do we need numerical dierentiation?


When analytical dierentiation is dicult or not possible. When the function is specied as a set of discrete points. To solve dierential equations numerically. (Chap 8-9)

Approaches
Finite dierence approximation (Sec 6.2-3) Dierentiating analytically after curve tting (Sec 6.6)

Noise and scatter in the data points


Higher-order formula Curve tting

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Finite Dierence Approximation of the Derivative


f (a) = lim f (a + h) f (a) f (a) f (a h) = lim h0 h0 h h f (a + h) f (a h) = lim h0 2h

Forward dierence df dx Backward dierence df dx Central dierence df dx

=
x=xi

f (xi+1 ) f (xi ) xi+1 xi

=
x=xi

f (xi ) f (xi1 ) x i x i 1

=
x=xi

f (xi+1 ) f (xi1 ) xi+1 xi1

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Two-Point Forward Dierence Formula for First Derivative


When the points are equally spaced : xi+1 = xi + h f (xi+1 ) = f (xi ) + f (xi )h + f (xi ) 2 f (xi ) 3 f (4) (xi ) 4 h + h + h + ... 2! 3! 4! f ( ) 2 = f (xi ) + f (xi )h + h (xi < < xi+1 ) 2! f (xi+1 ) f (xi ) f ( ) f (xi ) = h h 2! f (xi+1 ) f (xi ) f (xi ) = + O(h) h

( ) truncation error = f 2! h = O(h)

More Finite Dierence Formulas Using Taylor Series Expansion

Two-point backward dierence formula for rst derivative f (xi ) = f (xi ) f (xi1 ) + O(h) h

Two-point central dierence formula for rst derivative f (xi ) = More accurate f (xi+1 ) f (xi1 ) + O(h2 ) 2h

Three-Point Forward and Backward Dierence Formulas for the First Derivative
Central dierence formula is more accurate, but can be used only for the interior points. Forward and backward formulas can be used for the rst and last points respectively, but are less accurate. More accurate formula for the rst and last points? Three-point forward dierence (for the rst point) f (xi ) = 3f (xi ) + 4f (xi+1 ) f (xi+2 ) + O(h2 ) 2h

Three-point backward dierence (for the last point) f (xi ) = f (xi2 ) 4f (xi1 ) + 3f (xi ) + O(h2 ) 2h

Examples: First Derivatives

Example 6-1 (p.237) h forward dierence backward dierence central dierence Example 6-3 (p.244) h three-point forward dierence truncation error 1 0.25 2 0.125 truncation error 1 0.25 10 8 1 2.3125 2.1875 0.0625

Finite Dierence Formulas for the Second Drrivative


Three-point central dierence formula f (xi ) = f (xi1 ) 2f (xi ) + f (xi+1 ) + O(h2 ) h2

Five-point central dierence formula


f (xi ) = f (xi2 ) + 16f (xi1 ) 30f (xi ) + 16f (xi+1 ) f (xi+2 ) + O(h4 ) 12h2

Three-point forward dierence formula f (xi ) = f (xi ) 2f (xi+1 ) + f (xi+2 ) + O(h) h2

Three-point backward dierence formula f (xi ) = f (xi2 ) 2f (xi1 ) + f (xi ) + O(h) h2

Examples: Second Derivatives

Example 6-4 (p.246) h three-point central dierence truncation error 0.2 0.1 0.0028820 0.000724

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation

Outline
Background Finite Dierence Approximation of the Derivative Finite Dierence Formulas Using Taylor Series Expansion Summary of Finite Dierence Formulas for Numerical Dierentiation Dierentiation Formulas Using Lagrange Polynomials Dierentiation Using Curve Fitting Use of MATLAB Built-In Functions for Numerical Dierentiation Richardsons Extrapolation Error in Numerical Dierentiation Numerical Partial Dierentiation