ES 240: Scientific and Engineering Computation. a function f(x) that can be written as a finite series of power functions like

Similar documents
Engineering Analysis ENG 3420 Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

Multiple-Choice Test Spline Method Interpolation COMPLETE SOLUTION SET

UNIT #2 TRANSFORMATIONS OF FUNCTIONS

9.8 Graphing Rational Functions

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation

Piecewise polynomial interpolation

Handout 4 - Interpolation Examples

Interpolation - 2D mapping Tutorial 1: triangulation

Splines and Piecewise Interpolation. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Rational Functions. Definition A rational function can be written in the form. where N(x) and D(x) are

Three-Dimensional Object Representations Chapter 8

Neighbourhood Operations

The Rational Zero Theorem

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

8 Piecewise Polynomial Interpolation

Image Reconstruction. Prof. George Wolberg Dept. of Computer Science City College of New York

5.2 Properties of Rational functions

Numerical Analysis Fall. Numerical Differentiation

Lecture 9. Curve fitting. Interpolation. Lecture in Numerical Methods from 28. April 2015 UVT. Lecture 9. Numerical. Interpolation his o

Design considerations

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Chapter 3 Image Enhancement in the Spatial Domain

CS 450 Numerical Analysis. Chapter 7: Interpolation

Assignment 2. with (a) (10 pts) naive Gauss elimination, (b) (10 pts) Gauss with partial pivoting

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /4:30-6:00

Four equations are necessary to evaluate these coefficients. Eqn

1-2. Composition of Functions. OBJECTIVES Perform operations with functions. Find composite functions. Iterate functions using real numbers.

Transformations of Functions. Shifting Graphs. Similarly, you can obtain the graph of. g x x 2 2 f x 2. Vertical and Horizontal Shifts

Unit 1 Day 4 Notes Piecewise Functions

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Derivative. Bernstein polynomials: Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 313

Chapter 3. Interpolation. 3.1 Introduction

LECTURE NOTES - SPLINE INTERPOLATION. 1. Introduction. Problems can arise when a single high-degree polynomial is fit to a large number

( ) ( ) Completing the Square. Alg 3 1 Rational Roots Solving Polynomial Equations. A Perfect Square Trinomials

In some applications it may be important that the extrema of the interpolating function are within the extrema of the given data.

An introduction to interpolation and splines

Central issues in modelling

Session 3. Rational and Radical Equations. Math 30-1 R 3. (Revisit, Review and Revive)

99 International Journal of Engineering, Science and Mathematics

Graphs of quadratics functions are parabolas opening up if a > 0, and down if a < 0. Examples:

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010

Lesson 2.1 Exercises, pages 90 96

Concavity. Notice the location of the tangents to each type of curve.

Chapter 19 Interpolation

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Radical Functions Review

lecture 10: B-Splines

Objects 2: Curves & Splines Christian Miller CS Fall 2011

CS485/685 Computer Vision Spring 2012 Dr. George Bebis Programming Assignment 2 Due Date: 3/27/2012

9.3 Transform Graphs of Linear Functions Use this blank page to compile the most important things you want to remember for cycle 9.

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

February 2017 (1/20) 2 Piecewise Polynomial Interpolation 2.2 (Natural) Cubic Splines. MA378/531 Numerical Analysis II ( NA2 )

2.4. A LIBRARY OF PARENT FUNCTIONS

Math 2A Vector Calculus Chapter 11 Test Fall 07 Name Show your work. Don t use a calculator. Write responses on separate paper.

Natural Numbers and Integers. Big Ideas in Numerical Methods. Overflow. Real Numbers 29/07/2011. Taking some ideas from NM course a little further

Consider functions such that then satisfies these properties: So is represented by the cubic polynomials on on and on.

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

MAPI Computer Vision. Multiple View Geometry

Numerical Methods with Matlab: Implementations and Applications. Gerald W. Recktenwald. Chapter 10 Interpolation

NUMERICAL DIFFERENTIATION

Larger K-maps. So far we have only discussed 2 and 3-variable K-maps. We can now create a 4-variable map in the

Polynomials tend to oscillate (wiggle) a lot, even when our true function does not.

Name Class Date. To translate three units to the left, 3 from the -coordinate. To translate two units down, 2 from the -coordinate.

A Proposed Approach for Solving Rough Bi-Level. Programming Problems by Genetic Algorithm

Computational Physics PHYS 420

Computer Graphics / Animation

Dyadic Interpolation Schemes

CPS 303 High Performance Computing. Wensheng Shen Department of Computational Science SUNY Brockport

Mini-Lecture 8.1 Introduction to Radicals

ECE 6560 Multirate Signal Processing Chapter 8

Geometric Registration for Deformable Shapes 2.2 Deformable Registration

THE FINANCIAL CALCULATOR

08 - Designing Approximating Curves

Rational Bezier Curves

Graphing Functions. 0, < x < 0 1, 0 x < is defined everywhere on R but has a jump discontinuity at x = 0. h(x) =

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.

February 23 Math 2335 sec 51 Spring 2016

Algebra 2 Semester 1 (#2221)

Arxiv. Golden interpolation. Ying He a, Jincai Chang b, A B S T R A C T

The International Association for the Properties of Water and Steam

A Practical Review of Uniform B-Splines

Scientific Computing: Interpolation

Skill Sets Chapter 5 Functions

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

Approximate structural optimization using kriging method and digital modeling technique considering noise in sampling data

Cubic Spline Questions

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

Instructor: Virginia Davis Course: Foundations for College Math (1)

Lesson 8.1 Exercises, pages

Composite functions. [Type the document subtitle] Composite functions, working them out.

Binary recursion. Unate functions. If a cover C(f) is unate in xj, x, then f is unate in xj. x

Know it. Control points. B Spline surfaces. Implicit surfaces

Spatial Interpolation & Geostatistics

Research on Image Splicing Based on Weighted POISSON Fusion

Parameterization. Michael S. Floater. November 10, 2011

Using a Projected Subgradient Method to Solve a Constrained Optimization Problem for Separating an Arbitrary Set of Points into Uniform Segments

Digital Image Processing. Image Enhancement in the Spatial Domain (Chapter 4)

Transcription:

Polynomial Deinition a unction () that can be written as a inite series o power unctions like n is a polynomial o order n n ( ) = A polynomial is represented by coeicient vector rom highest power. p=[3-5 -7 9] p() = 3 4-5 3 7 + + 9 n i= 0 a i i

Polynomial Operations poly(r) convert roots to a polynomial r=[ 3 ]; poly(r) roots(p) ind roots o a polynomial p=[ 3 4 ] roots(p) Y = polyval(p, ) returns the value o a polynomial, p(). P is a vector o length N+ whose elements are the coeicients o the polynomial in descending powers. p=[3-5 -7 9] p() = 3 4-5 3 7 + + 9

Polynomial Operations P = polyit(, y, n) Returns the least squares it coeicients o a polynomial p() o degree n P is o length N+. conv(p,p) multiply two polynomials p and p conv(p,p) [q r]=deconv(p,p) polynomials p divide by p, where q is quotient and r is remainder [q r]=deconv(p,p)

Polynomial Operations polyint(p,c) integrate o polynomial p with integration constant c (deault 0) polyint(p) polyint(p,) polyder(p) dierentiate polynomial p respective to >> polyder(p)

Curve Fitting Applications Estimating the value o points between discrete values Simpliying complicated unctions Methods Data are very precise curve passes through all points curve itting Data are just approimations curve represent a general trend o the data

Curve Fitting and Curve Fitting (linear or non-linear) Linear (most popular interpolation) Other (higher order polynomial, spline, nearest, )

Linear The linear interpolation is achieved by itting a line between two known data points The resulting ormula based on known points and and the values o the dependent unction at those points is: ()= ( )+ ( ) ( ) ( )

Quadratic (Polynomial) One problem that can occur with solving or the coeicients o a polynomial is that the system to be inverted is in the orm: n L n L M M O M M n n n L n n n L n n n n n n Matrices such as that on the let are known as Vandermonde matrices, and they are very ill-conditioned - meaning their solutions are very sensitive to round-o errors. The issue can be minimized by scaling and shiting the data. p p M p n p n ( ) ( ) = M n n ( ) ( )

Newton Interpolating Polynomials Newton Interpolating Polynomials Another way to epress a polynomial interpolation is to use Newton s interpolating polynomial. This is a achieved by an etension to linear interpolation ) )( 3( ) ( ) ( ) ( ) ( ) ( ) ( Newton Simple Order 3 b b b a a a nd b b a a st + + = + + = + = + = ( ) ( ) ( ) ( ) 3 3 3 3 ) ( ) ( ); ( b b b = = =

Newton Interpolating Polynomials (cont) Newton Interpolating Polynomials (cont) The second-order Newton interpolating polynomial introduces some curvature to the line connecting the points, but still goes through the irst two points. The resulting ormula based on known points,, and 3 and the values o the dependent unction at those points is: ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )( ) 3 3 3 + + =

Generalization An (n-) th Newton interpolating polynomial has all the terms o the (n-) th polynomial plus one etra. The general ormula is: where n ()= b + b ( )+L+ b n ( ) ( )L n ( ) and the [ ] represent divided dierences. b = ( ) [ ] [ ] b =, b 3 = 3,, M [ ] b n = n, n,l,,

Divided Dierences Divided dierence are calculated as ollows: ( ) [ i, j ]= ( i) j i j [ i, j, k ]= [ i, j ] [ j, k ] i k [ n, n,l,, ]= [,,L, n n ] n, n,l, [ ] Divided dierences are calculated using n divided dierence o a smaller number o terms:

Eample 5. Do by hand Use the newtint unction

Lagrange Interpolating Polynomials Weighted average o the two values being connected The dierences between a simple polynomial and Lagrange interpolating polynomials or irst and second order polynomials is: Order Simple Lagrange st () = a + a () = L ( )+ L ( ) nd () = a + a + a 3 () = L ( )+ L ( )+ L 3 3 ( ) where the L i are weighting coeicients that are unctions o.

The irst-order Lagrange interpolating polynomial may be obtained rom a weighted combination o two linear interpolations, as shown. Lagrange Interpolating Polynomials (cont) The resulting ormula based on known points and and the values o the dependent unction at those points is: () = L ( )+ L ( ) L =, L = () = ( )+ ( )

Lagrange Interpolating Polynomials (cont) In general, the Lagrange polynomial interpolation or n points is: n ( )= L i i n i= ()( i ) where L i is given by: L i ()= n j= j i j i j

Eample 5. Solve by hand Use the lagrange unction

Etrapolation Etrapolation is the process o estimating a value o () that lies outside the range o the known base points,,, n. Etrapolation represents a step into the unknown, and etreme care should be eercised when etrapolating!

Etrapolation Hazards World population using a 7 th order polynomial etrapolation.

Oscillations Higher-order polynomials can not only lead to round-o errors due to ill-conditioning, but can also introduce oscillations to an interpolation or it where they should not be. In the igures below, the dashed line represents a unction, the circles represent samples o the unction, and the solid line represents the results o a polynomial interpolation:

Introduction to Splines An alternative approach to using a single (n-) th order polynomial to interpolate between n points is to apply lower-order polynomials in a piecewise ashion to subsets o data points. These connecting polynomials are called spline unctions. Splines minimize oscillations and reduce roundo error due to their lower-order nature.

Higher Order vs. Splines Splines eliminate oscillations by using small subsets o points or each interval rather than every point. This is especially useul when there are jumps in the data: a) 3 rd order polynomial b) 5 th order polynomial c) 7 th order polynomial d) Linear spline seven st order polynomials generated by using pairs o points at a time

Spline Development a) First-order splines ind straight-line equations between each pair o points that Go through the points b) Second-order splines ind quadratic equations between each pair o points that Go through the points Match irst derivatives at the interior points c) Third-order splines ind cubic equations between each pair o points that Go through the points Match irst and second derivatives at the interior points Note that the results o cubic spline interpolation are dierent rom the results o an interpolating cubic.

Spline Development Spline unction (s i ())coeicients are calculated or each interval o a data set. The number o data points ( i ) used or each spline unction depends on the order o the spline unction.

Cubic Splines While data o a particular size presents many options or the order o spline unctions, cubic splines are preerred because they provide the simplest representation that ehibits the desired appearance o smoothness. In general, the i th spline unction or a cubic spline can be written as: s i ()= a i + b i i ( )+ c i i ( ) + d i ( i ) 3 For n data points, there are n- intervals and thus 4(n-) unknowns to evaluate to solve all the spline unction coeicients. There is no one equation that can represent the whole spline unction on the domain

Piecewise in MATLAB MATLAB has several built-in unctions to implement piecewise interpolation. The irst is spline: yy=spline(,y,) This perorms cubic spline interpolation

Eample Generate data: = linspace(-,,9); y =./(+5*.^); Calculate 00 model points and determine not-a-knot interpolation = linspace(-, ); yy = spline(,y,); Calculate actual unction values at model points and data points, the 9-point (solid), and the actual unction (dashed), yr =./(+5*.^) plot(,y, o,, yy, -,,yr, -- )

MATLAB s interp Function While spline can only perorm cubic splines, MATLAB s interp unction can perorm several dierent kinds o interpolation: yi =interp(, y,i, method ) & y contain the original data i contains the points at which to interpolate method is a string containing the desired method: nearest - nearest neighbor interpolation linear - connects the points with straight lines spline - not-a-knot cubic spline interpolation pchip or cubic - piecewise cubic Hermite interpolation

Lab 5.9