ChE 250 Numeric Methods - PowerPoint PPT Presentation

About This Presentation
Title:

ChE 250 Numeric Methods

Description:

It is often more convenient to use Lagrange Polynomials ... those closest to the desired value, and throw away the rest of the given points ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 18
Provided by: christi183
Category:

less

Transcript and Presenter's Notes

Title: ChE 250 Numeric Methods


1
ChE 250 Numeric Methods
  • Lecture 18
  • Chapra, Chapter 18 Interpolation
  • Chapter 19 Fourier Approximation
  • 20070319

2
Today
  • Interpolation
  • Lagrange Interpolating Polynomial
  • Spline
  • Fourier Approximation
  • Least Squares
  • Continuous Fourier series
  • Time and Frequency domain
  • Fast Fourier Transform

3
Lagrange Polynomials
  • Calculating the finite differences required for
    Newtons Interpolation can sometimes be
    cumbersome
  • It is often more convenient to use Lagrange
    Polynomials
  • These are calculated by a product of the
    differences of the independent value for
    surrounding data points

4
Lagrange Polynomials
  • Terminology an nth order Lagrange Polynomial
    requires n1 data points
  • The points used in the calculation should be
    those closest to the desired value, and throw
    away the rest of the given points
  • Several polynomials can be solved and the best
    one chosen
  • An r2 can also be calculated

5
Lagrange Polynomials
  • Equation The polynomials are Li which are
    calculated using the Pi, product
  • Example 18.6
  • Questions?

6
Lagrange Polynomials
  • Which is the best fit?
  • (a) 4th order
  • (b) 3rd order
  • (c) 2nd order
  • (d) 1st order

Time, s Measured Velocity, cm/s
1 800
3 2310
5 3090
7 3940
13 4755
7
Lagrange Polynomials
  • Summary
  • Newtons polynomial may be better when attempting
    to determine the order of the polynomial to use
  • Can calculate error easily
  • Lagrange method is easier to implement when the
    order of the polynomial fit is known
  • Both will have significant rounding error for
    higher orders

8
Spline Interpolation
  • Connect the dots method
  • First order is exactly like a linear
    interpolation
  • Second order (quadratic) matches the value and
    the first derivative
  • Third order (cubic) matches value, first and
    second derivative at each interior point, or knot

9
Spline Interpolation
  • Cubic spline can be represented by a function in
    each interval of the form
  • By setting the first derivatives at the interior
    knots equal on adjacent cubics
  • And also the second derivatives

10
Spline Interpolation
  • Now, we have to solve for all the as, bs, cs
    and ds using some form of simultaneous solution,
    or matrix solution for larger sets

11
Spline Interpolation
  • For Scilab, The splin function with natural
    argument returns the derivative vector
  • This can be used with the interp function to
    interpolate a value

Example 18.10, Cubic Spline on Scilab
12
Spline Interpolation
  • Splines have the distinct advantage of sitting a
    dataset very well, no matter how discontinuous
    the data is
  • Even if the data changes regimes
  • Example 18.10
  • Questions?

13
Fourier Approximation
  • Polynomials fit many functions associated with
    physical properties
  • But when functions of time are considered, they
    are often periodic and not well-modeled by
    polynomials

14
Fourier Approximation
  • Polynomials fit many functions associated with
    physical properties
  • But when functions of time are considered, they
    are often periodic and not well-modeled by
    polynomials

15
Fourier Approximation
  • The Fourier series transforms a given periodic
    function into a superposition of sine and cosine
    waves
  • The following equations are used

16
Fourier Approximation
  • For cases where the function is not known, but a
    data set with points equally spaced in time is
    available, the data can be fitted using a Fast
    Fourier Transform
  • This is done routinely in electronic equipment
    including laboratory analysis
  • e. g. spectroscopy
  • FFT Example
  • Questions?

17
(No Transcript)
18
Preparation for 16Mar
  • Reading
  • Chapter 19 Fourier Approximation
  • Homework Due Friday
  • Chapter 17
  • 4, 7,9,12, 17,25,29
  • Chapter 18
  • 5, 7, 11, 13
  • Chapter 19
  • 4, 6, 12, 14, 22
  • Chapter 20
  • 12, 14, 17
Write a Comment
User Comments (0)
About PowerShow.com