Mark Trew CT1 2002. Halfway Down Halfway down the stairs Is a stair Where I sit. There isn't any Other stair Quite like It. I'm not at the bottom, I'm.

Slides:



Advertisements
Similar presentations
Splines and Piecewise Interpolation
Advertisements

Lecture Notes #11 Curves and Surfaces II
Numeriska beräkningar i Naturvetenskap och Teknik Today’s topic: Approximations Least square method Interpolations Fit of polynomials Splines.
Chapter 3. Interpolation and Extrapolation Hui Pan, Yunfei Duan.
CE33500 – Computational Methods in Civil Engineering Differentiation Provided by : Shahab Afshari
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
MATH 685/ CSI 700/ OR 682 Lecture Notes
Trajectory Generation
Chapter 18 Interpolation The Islamic University of Gaza
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
1 Curve-Fitting Spline Interpolation. 2 Curve Fitting Regression Linear Regression Polynomial Regression Multiple Linear Regression Non-linear Regression.
Computational Methods in Physics PHYS 3437
EARS1160 – Numerical Methods notes by G. Houseman
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
Chapter 9 Gauss Elimination The Islamic University of Gaza
PHYS2020 NUMERICAL ALGORITHM NOTES ROOTS OF EQUATIONS.
Curve-Fitting Interpolation
1cs426-winter-2008 Notes  Ian Mitchell is running a MATLAB tutorial, Tuesday January 15, 5pm-7pm, DMP 110 We won’t be directly using MATLAB in this course,
Curve-Fitting Regression
Engineering Computation Curve Fitting: Interpolation 1
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 23 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 24 Regression Analysis-Chapter 17.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Interpolation Chapter 18.
Chapter 6 Numerical Interpolation
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. by Lale Yurttas, Texas A&M University Chapter 171 Least.
Calibration & Curve Fitting
CpE- 310B Engineering Computation and Simulation Dr. Manal Al-Bzoor
Computational Methods in Physics PHYS 3437 Dr Rob Thacker Dept of Astronomy & Physics (MM-301C)
9/7/ Gauss-Siedel Method Chemical Engineering Majors Authors: Autar Kaw Transforming.
Interpolation. Interpolation is important concept in numerical analysis. Quite often functions may not be available explicitly but only the values of.
Chapter 15 Modeling of Data. Statistics of Data Mean (or average): Variance: Median: a value x j such that half of the data are bigger than it, and half.
Solving Quadratic Equations
V. Space Curves Types of curves Explicit Implicit Parametric.
Regression analysis Control of built engineering objects, comparing to the plan Surveying observations – position of points Linear regression Regression.
Lecture 22 - Exam 2 Review CVEN 302 July 29, 2002.
Review Taylor Series and Error Analysis Roots of Equations
Curves.
CISE301_Topic41 CISE301: Numerical Methods Topic 4: Least Squares Curve Fitting Lectures 18-19: KFUPM Read Chapter 17 of the textbook.
Today’s class Spline Interpolation Quadratic Spline Cubic Spline Fourier Approximation Numerical Methods Lecture 21 Prof. Jinbo Bi CSE, UConn 1.
Polynomial Interpolation You will frequently have occasions to estimate intermediate values between precise data points. The function you use to interpolate.
Chapter 8 Curve Fitting.
Curve-Fitting Regression
Computers in Civil Engineering 53:081 Spring 2003 Lecture #15 Spline Interpolation.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
Jump to first page Chapter 3 Splines Definition (3.1) : Given a function f defined on [a, b] and a set of numbers, a = x 0 < x 1 < x 2 < ……. < x n = b,
Cubic Spline Interpolation. Cubic Splines attempt to solve the problem of the smoothness of a graph as well as reduce error. Polynomial interpolation.
Lecture 6 - Single Variable Problems & Systems of Equations CVEN 302 June 14, 2002.
3/6/ Gauss-Siedel Method Major: All Engineering Majors Author: دکتر ابوالفضل رنجبر نوعی
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Interpolation - Introduction
11/22/ Differentiation-Discrete Functions.
Part 5 - Chapter
ECE3340 Numerical Fitting, Interpolation and Approximation
Part 5 - Chapter 17.
Chapter 10-2: Curves.
Curve-Fitting Spline Interpolation
Gauss-Siedel Method.
Interpolation Estimation of intermediate values between precise data points. The most common method is: Although there is one and only one nth-order.
Chapter 18.
Interpolation.
Chapter 18.
Part 5 - Chapter 17.
Today’s class Multiple Variable Linear Regression
Linear regression Fitting a straight line to observations.
Splines and Piecewise Interpolation
Discrete Least Squares Approximation
Splines There are cases where polynomial interpolation is bad
SKTN 2393 Numerical Methods for Nuclear Engineers
Theory of Approximation: Interpolation
Presentation transcript:

Mark Trew CT1 2002

Halfway Down Halfway down the stairs Is a stair Where I sit. There isn't any Other stair Quite like It. I'm not at the bottom, I'm not at the top; So this is the stair Where I always Stop. Halfway up the stairs Isn't up, And isn't down. It isn't in the nursery, It isn't in the town. And all sorts of funny thoughts Run round my head: "It isn't really Anywhere! It's somewhere else instead!"

Mark Trew CT Halfway Down Halfway down the stairs Is a stair Where I sit. There isn't any Other stair Quite like It. I'm not at the bottom, I'm not at the top; So this is the stair Where I always Stop. Halfway up the stairs Isn't up, And isn't down. It isn't in the nursery, It isn't in the town. And all sorts of funny thoughts Run round my head: "It isn't really Anywhere! It's somewhere else instead!" A.A. Milne

Mark Trew CT Interpolation – the ups and downs

Mark Trew CT Interpolation and Fitting Discrete datum points obtained by some process Provide basis for a description of behaviour at any point Description usually in some function form: Function can have some physical form based on theoretical behaviour or can be a more general form Use interpolation every day, e.g. measurements, weights, solving ODEs etc. or

Mark Trew CT Interpolation and Fitting Interpolation vs Fitting – in general: -Interpolation reproduces datum values at the datum locations -Fitting seeks to provide the best overall description Interpolation vs Extrapolation -Interpolation: unknown value bracketed by known values -Extrapolation: unknown value has known value on one side only x y x y

Mark Trew CT Polynomial Interpolation Determine the coefficients of a polynomial one order less than the number of datum points: Coefficients found by solving linear system of equations: Significant problems with this kind of interpolation, especially as the number of datum points becomes large: 1.“expensive” to solve for the coefficients 2.System of equations (Vandermonde matrix) becomes ill- conditioned 3.High order polynomials oscillate between points

Mark Trew CT Polynomial (and other) Fitting Polynomials useful for small number of points – at least 3 for a quadratic Can be useful for fitting rather than datum interpolation Given polynomial to “reasonable” order, find coefficients such that function is a good representation of data, e.g. minimise the sum of the squared difference between function and datum values (called Least Squares Fit): If we have N data points and our polynomial is of order m, how can we solve? The problem is overdetermined. know don’t know

Mark Trew CT Polynomial (and other) Fitting Problem looks like: Two options: 1.Solve the normal equations: A T Aa = A T b. Solved by standard LU decomposition, but tend to be badly conditioned and prone to roundoff error. 2.Do a singular value decomposition on A. Naturally finds the solution which is the best least squares approximation. A=a=a=b=b= Aa=bAa=b

Mark Trew CT Up or Down? Up Down Halfway up the stairs Isn't up, And isn't down. It isn't in the nursery, It isn't in the town. How much up and how much down?

Mark Trew CT Lagrangian Interpolation Used for large number of datum points Break whole interpolation range into smaller intervals Use low order polynomial to interpolate over sub-interval only Overcomes problems with high-order polynomial interpolation x y entire range sub-interval

Mark Trew CT Linear Lagrange Interpolation x y sub-interval Put a straight line between each pair of points (x j,y j ) (x j+1,y j+1 ) yj(x)yj(x) What form do L j and L j+1 take?

Mark Trew CT Linear Lagrange Interpolation x x y sub-interval Put a straight line between each pair of points (x j,y j ) (x j+1,y j+1 ) yj(x)yj(x) L j+1 1 xjxj x j+1 Important!! L act as weighting functions: some of y j and some of y j+1

Mark Trew CT Quadratic Lagrange Interpolation x y sub-interval Put a quadratic between each triplet of points (x j-1,y j-1 )(x j,y j ) yj(x)yj(x) (x j+1,y j+1 )

Mark Trew CT Quadratic Lagrange Interpolation L j-1 1 x j-1 x j+1 xjxj LjLj 1 x j-1 x j+1 xjxj L j+1 1 x j-1 x j+1 xjxj

Mark Trew CT Quadratic Lagrange Interpolation Still true? Check! L continue to act as weighting functions: some of y j-1, some of y j, and some of y j+1

Mark Trew CT Lagrange Interpolation of any Order An mth order Lagrange interpolation using m+1 datum points is represented by: The weighting functions, or Lagrange polynomials, are described by: multiply

Mark Trew CT Lagrange Interpolation of any Order Always true that: A problem with Lagrange interpolation is the lack of slope continuity between the sub-interval (element) boundaries. x y sub-interval (x j-1,y j-1 )(x j,y j ) (x j+1,y j+1 ) slope discontinuous Not always important

Mark Trew CT Next time… Function continuity and Cubic Splines

Mark Trew CT The story continues… Function continuity and Cubic Splines

Mark Trew CT Function Continuity

Mark Trew CT Function Continuity C 0 continuity – value continuous C 1 continuity – gradient or slope continuous C 2 continuity – curvature (2 nd derivative) continuous

Mark Trew CT Interpolation with Slope Continuity Four “degrees of freedom” over interval: p j (x j ), p j (x j+1 ), p’ j (x j )=k j and p’ j (x j+1 )=k j+1 Four dof can be fitted by a cubic polynomial. Gradients may be known at x 0 and x N. May be reasonable to set p’’=0 at x 0 and x N. x y sub-interval: j xjxj x j+1 yj(x)yj(x) Definitions: kjkj k j+1 p’’  0 p’’=0

Mark Trew CT Cubic Spline Polynomial General form: Spline – from thin rods used by engineers to fit smooth curves through a number of points. p j (x) must satisfy: p j (x j )=y j, p j (x j+1 )=y j+1, p’ j (x j )=k j and p’ j (x j+1 )=k j+1 Two steps to make p j (x) useful. (1) Determine a 0 to a 3. (2) Determine k values. Two sets of equations necessary.

Mark Trew CT Step 1: Spline Coefficients To satisfy: p j (x j )=y j, p’ j (x j )=k j, p j (x j+1 )=y j+1 and p’ j (x j+1 )=k j+1

Mark Trew CT …some algebra later…

Mark Trew CT Step 1: Spline Coefficients Solving for a 2 and a 3 : Once the k j values are known, the spline function is determined.

Mark Trew CT Step 2: Unknown Gradients x y’’ sub-interval: j xjxj p’’ j-1 (x) sub-interval: j-1 p’’ j (x) For cubic in each interval: Evaluating the second derivatives: Equating the second derivatives:

Mark Trew CT Step 2: Unknown Gradients Known or assumed information: If k 0 and k N are known, there are N-1 points, N-1 unknown k values and N-1 equations. Equal number of equations and unknowns. x y x0x0 xNxN k0k0 kNkN y’’ N-1 (x N )=0 y’’ 0 (x 0 )=0 N-1 internal points

Mark Trew CT Step 2: Unknown Gradients If k 0 and k N are not known, there are N+1 points, N+1 unknown k values and N-1 equations of the type: and two equations: from the condition of zero curvature (p’’=0) at the end-points. Still equal number of equations and unknowns.

Mark Trew CT Step 2: Unknown Gradients In both cases, equations are put together into a matrix of linear equations in the unknown k values. The system of equations is solved. Each row has only 3 non-zero terms – one on either side of the diagonal. Very efficient to solve. = k

Mark Trew CT Summary Gradient continuous interpolations can be produced using cubic splines. Gradients must be known at the extremum points – or assumption of zero curvature can be used. System of linear equations solved to give gradients at each discrete point. (Step 2) Gradients used to determine coefficents of cubic spline interpolation for each sub-interval. (Step 1) Cubic splines can be used to interpolate to x points lying between known discrete points.

Mark Trew CT The end…