Download presentation
Presentation is loading. Please wait.
Published byCorey Small Modified over 10 years ago
1
Computers in Civil Engineering 53:081 Spring 2003 Lecture #14 Interpolation
2
Interpolation: Overview l Objective: estimate intermediate values between precise data points using simple functions l Solutions –Newton Polynomials –Lagrange Polynomials –Spline Interpolation InterpolationCurve Fitting multiple values Curve need not go through data points single value Curve goes through data points
3
High-precision data points Example
4
Braidwood LaSalle Dresden QuadCities
5
Quad Cities Nuclear Generating Station
6
Quad-Cities Nuke Station Diffuser Curve
7
Examples of Simple Polynomials Fist-order (linear) Second-order (quadratic) Third-order (cubic)
8
Newton’s Divided-Difference Interpolating Polynomials l General comments l Linear Interpolation l Quadratic Interpolation l General Form
9
Linear Interpolation Formula By similar triangles: Rearrange: The notation: means the first order interpolating polynomial
10
Estimate ln(2) (the true value is 0.69) We know that: at x = 1 ln(x) =0 at x = e ln(x) =1 (e=2.718...) Thus, Example Problem: Solution:
11
General form: Equivalent form: To solve for,three points are needed: Quadratic Interpolation (f 2 (x) means second-order interpolating polynomial)
12
Set in (1) to find Substitute in (1) and evaluate at to find: Quadratic Interpolation Note: this looks like a second derivative…
13
Example Estimate ln(2) (the true value is 0.69) We know that: at x = x 0 = 1 ln(x) =0 at x = x 1 = e ln(x) =1 (e=2.718...) at x = x 2 = e 2 ln(x) = 2 Problem Solution
14
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
15
To solve for, n+1 points are needed: Solution General form of Newton’s Interpolating Polynomials What does this [ ] notation mean?
16
First finite divided difference: nth finite divided difference: Finite Divided Differences Second finite divided difference:
17
Finite divided difference table, case n = 3: Finite Divided Differences
18
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
19
Example – ln(2) again
21
Newton Interpolation Pseudo Code See the textbook!
22
Features of Newton Divided-Differences to get Interpolating Polynomial l Data need not be equally spaced l Arrangement of data does not have to be ascending or descending, but it does influence error of interpolation l Best case is when the base points are close to the unknown value l Estimate of relative error: Error estimate for n th-order polynomial is the difference between the ( n +1)th and n th-order prediction.
23
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
24
Tuesday 15 April Midterm 2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.