Computers in Civil Engineering
This presentation is the property of its rightful owner.
Sponsored Links
1 / 23

Computers in Civil Engineering 53:081 Spring 2003 PowerPoint PPT Presentation


  • 80 Views
  • Uploaded on
  • Presentation posted in: General

Computers in Civil Engineering 53:081 Spring 2003. Lecture #14. Interpolation. Interpolation: Overview. Objective: estimate intermediate values between precise data points using simple functions Solutions Newton Polynomials Lagrange Polynomials Spline Interpolation. Interpolation.

Download Presentation

Computers in Civil Engineering 53:081 Spring 2003

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Computers in civil engineering 53 081 spring 2003

Computers in Civil Engineering53:081 Spring 2003

Lecture #14

Interpolation


Interpolation overview

Interpolation: Overview

  • Objective: estimate intermediate values between precise data points using simple functions

  • Solutions

    • Newton Polynomials

    • Lagrange Polynomials

    • Spline Interpolation

Interpolation

Curve Fitting

Curve goes through data points

single value

Curve need not go through data points

multiple values


Example

Example

High-precision data points


Computers in civil engineering 53 081 spring 2003

Quad

Cities

Dresden

LaSalle

Braidwood


Computers in civil engineering 53 081 spring 2003

Quad-Cities Nuke Station Diffuser Curve


Examples of simple polynomials

Examples of Simple Polynomials

Fist-order (linear)

Third-order (cubic)

Second-order (quadratic)


Newton s divided difference interpolating polynomials

Newton’s Divided-Difference Interpolating Polynomials

  • General comments

  • Linear Interpolation

  • Quadratic Interpolation

  • General Form


Linear interpolation formula

The notation: means the first order interpolatingpolynomial

Linear Interpolation Formula

By similar triangles:

Rearrange:


Example1

Example

Problem:

Estimate ln(2)(the true value is 0.69)

Solution:

We know that:

at x = 1 ln(x) =0

at x = e ln(x) =1 (e=2.718...)

Thus,


Quadratic interpolation

Quadratic Interpolation

General form:

Equivalent form:

(f2(x) means second-order interpolating polynomial)

To solve for ,three points are needed:


Quadratic interpolation1

Set in (1) to find

Substitute in (1) and evaluate at to find:

Substitute in (1) and evaluate at to find:

Quadratic Interpolation

Note: this looks

like a second

derivative…


Example2

Example

Problem

Estimate ln(2)(the true value is 0.69)

Solution

We know that:

at x = x0 = 1 ln(x) =0

at x = x1 = e ln(x) =1 (e=2.718...)

at x = x2= e2 ln(x) = 2


How to generalize this

How to Generalize This?

It would get pretty tedious to do this for third,

fourth, fifth, sixth, etc order polynominal

We need a plan:

Newton’s Interpolating Polynomials


General form of newton s interpolating polynomials

General form of Newton’s Interpolating Polynomials

To solve for , n+1 points are needed:

Solution

What does this [ ]

notation mean?


Finite divided differences

Finite Divided Differences

First finite divided difference:

Second finite divided difference:

nth finite divided difference:


Finite divided differences1

Finite Divided Differences

Finite divided difference table, case n = 3:


Divided differences pseudo code

do i=0,n-1

fdd(i,1)=f(i)

enddo

do j=2,n

do i=1,n-j+1

fdd(i,j)=(fdd(i+1,j-1)-fdd(i,j-1))/

& (x(i+j-1)-x(i))

enddo

enddo

Divided Differences Pseudo Code


Example ln 2 again

Example – ln(2) again


Newton interpolation pseudo code

Newton Interpolation Pseudo Code

See the textbook!


Features of newton divided differences to get interpolating polynomial

Features of Newton Divided-Differences to get Interpolating Polynomial

  • Data need not be equally spaced

  • Arrangement of data does not have to be ascending or descending, but it does influence error of interpolation

  • Best case is when the base points are close to the unknown value

  • Estimate of relative error:

Error estimate for nth-order polynomial is the difference between the (n+1)th and nth-order prediction.


Relative error as a function of order

Relative Error As a Function of Order

Example 18.5 in text

Determine ln(2) using the following table

MATLAB function interp1 is very useful for this


Midterm 2

Midterm 2

Tuesday 15 April


  • Login