Lecture 18 Numerical Differentiation - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Lecture 18 Numerical Differentiation

Description:

Use the Taylor series expansion to represent three points about single location: ... derivatives, use the Taylor series expansions of term and eliminate the terms ... – PowerPoint PPT presentation

Number of Views:115
Avg rating:3.0/5.0
Slides: 42
Provided by: San59
Category:

less

Transcript and Presenter's Notes

Title: Lecture 18 Numerical Differentiation


1
Lecture 18 - Numerical Differentiation
  • CVEN 302
  • July 19, 2002

2
Lectures Goals
  • Finite Difference Schemes
  • Taylor Series Expansion for Differentiation
  • Basic Numerical Integration
  • Trapezoidal Rule
  • Simpsons Rule
  • Midpoint
  • Gaussian Quadrature

3
Calculus - Numerical Methods
Differentiation
Integration
4
Numerical Differentiation
  • Estimate the derivatives (slope, curvature, etc.)
    of a function by using the function values at
    only a set of discrete points
  • Ordinary differential equation (ODE)
  • Partial differential equation (PDE)

5
Numerical Differentiation
  • Represent the function by Taylor polynomials or
    Lagrange interpolation
  • Evaluate the derivatives of the interpolation
    polynomial at selected nodal points

6
Numerical Differentiation
A Taylor series or Lagrange interpolation of
points can be used to find the derivatives. The
Taylor series expansion is defined as
7
First Derivative at a Point
i-2 i-1 i
i1 i2
8
Numerical Differentiation
Use the Taylor series expansion to represent
three points about single location
9
Numerical Differentiation
Assume that the data points are equally spaced
and the equations can be written as
10
Forward Differentiation
For a forward first derivative, subtract eqn2
from eqn1
Rearrange the equation
11
Forward Differentiation
As the Dx gets smaller the error will get smaller
The error is defined as
12
Backward Differentiation
Subtract eqn3 from eqn2
The error is defined as
13
Central Differentiation
Subtract eqn3 from eqn1
The error is defined as
14
Differential Error
Notice that the errors of the forward and
backward 1st derivative of the equations have an
error of the order of O(Dx) and the central
differentiation has an error of order O(Dx2).
The central difference has an better accuracy and
lower error that the others. This can be
improved by using more terms to model the first
derivative.
15
Numerical Differentiation
If you want to improve the accuracy and decrease
the error you will need to eliminate terms
16
Higher Order Errors in Differentiation
The terms become
The terms become A-3, B 4 and C-1
17
Higher Order 1st Derivative
Parabolic curve
i-2 i-1 i
i1 i2
18
Higher Order Derivatives
To find higher derivatives, use the Taylor series
expansions of term and eliminate the terms from
the sum of equations. To improve the error in
the problem add additional terms.
19
2nd Derivative of the Function
It will require three terms to get a central 2nd
derivative of discrete set of data.
20
2nd Order Central Difference
The terms become
The terms become A1,B-2 and C1. Therefore
21
Lagrange Differentiation
Another form of differentiation is to use the
Lagrange interpolation between three points. The
values can be determine for unevenly spaced
points. Given
22
Lagrange Differentiation
Differentiate the Lagrange interpolation
Assume a constant spacing
23
Lagrange Differentiation
Differentiate the Lagrange interpolation
Various locations
24
Lagrange Differentiation
To find a higher order derivative from the
Lagrange interpolation for a three point Lagrange
Take the derivative
25
Partial Derivatives
  • Straightforward extension of one-dimensional
    formula

(i, j2)
(i, j1)
(i1, j1)
(i-1, j1)
(i-2, j)
(i-1, j)
(i, j)
(i1, j)
(i2, j)
(i, j-1)
(i-1, j-1)
(i1, j-1)
(i, j-2)
26
(i, j2)
(i, j1)
(i1, j1)
(i-1, j1)
(i-2, j)
(i-1, j)
(i, j)
(i1, j)
(i2, j)
(i, j-1)
(i-1, j-1)
(i1, j-1)
(i, j-2)
27
Partial Derivatives
Laplacian Operator
j1
j
j-1
i-1
i
i1
28
Partial Derivatives
Mixed Derivative
j1
j
j-1
i-1
i
i1
29
Bi-harmonic Operator
j2
j1
j
j-1
j-2
i-1
i1
i-2
i2
i
30
Richardson Extrapolation
This technique uses the concept of variable grid
sizes to reduce the error. The technique uses a
simple method for eliminating the error. Consider
a second order central difference technique.
Write the equation in the form
31
Richardson Extrapolation
The central difference can be defined as
Write the equation with different grid sizes
32
Richardson Extrapolation
Expand the terms
33
Richardson Extrapolation
Multiply eqn 2 by 4 and subtract eqn 1 from
it.
34
Richardson Extrapolation
The equation can be rewritten as
It can be rewritten in the form
35
Richardson Extrapolation
The technique can be extrapolated to include the
higher order error elimination by using a finer
grid.
36
Richardson Extrapolation Example
The function is given
Find the first derivative at x1.25 using a
central difference scheme and Dh 0.25. The
exact solution
37
Richardson Extrapolation Example
The data points are
The derivatives using central difference
38
Richardson Extrapolation Example
The results of the central difference scheme are
The Richardson Extrapolation uses these results
to find a better solution
39
Summary
  • Finite Difference Techniques
  • Taylor Series
  • Lagrange Polynomials
  • Error Calculation

40
Summary
  • Finite Difference Techniques
  • Forward Difference Scheme
  • Backward Difference Scheme
  • Central Difference Scheme

41
Homework
  • Check the Homework webpage
Write a Comment
User Comments (0)
About PowerShow.com