Interpolation, Smoothing, Extrapolation

Similar documents
SUBSTITUTION I.. f(ax + b)

Factoring Polynomials

Reasoning to Solve Equations and Inequalities

Review guide for the final exam in Math 233

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

15.6. The mean value and the root-mean-square value of a function. Introduction. Prerequisites. Learning Outcomes. Learning Style

Operations with Polynomials

Lecture 3 Gaussian Probability Distribution

Integration by Substitution

Binary Representation of Numbers Autar Kaw

CHAPTER 11 Numerical Differentiation and Integration

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

QUADRATURE METHODS. July 19, Kenneth L. Judd. Hoover Institution

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

Physics 43 Homework Set 9 Chapter 40 Key

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

9 CONTINUOUS DISTRIBUTIONS

Lecture 5. Inner Product

4.11 Inner Product Spaces

5.2. LINE INTEGRALS 265. Let us quickly review the kind of integrals we have studied so far before we introduce a new one.

1. Find the zeros Find roots. Set function = 0, factor or use quadratic equation if quadratic, graph to find zeros on calculator

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

Integration. 148 Chapter 7 Integration

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

Review Problems for the Final of Math 121, Fall 2014

Experiment 6: Friction

EQUATIONS OF LINES AND PLANES

Geometry 7-1 Geometric Mean and the Pythagorean Theorem

Unit 6: Exponents and Radicals

Babylonian Method of Computing the Square Root: Justifications Based on Fuzzy Techniques and on Computational Complexity

4 Approximations. 4.1 Background. D. Levy

g(y(a), y(b)) = o, B a y(a)+b b y(b)=c, Boundary Value Problems Lecture Notes to Accompany

SPECIAL PRODUCTS AND FACTORIZATION

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

All pay auctions with certain and uncertain prizes a comment

Or more simply put, when adding or subtracting quantities, their uncertainties add.

Math 135 Circles and Completing the Square Examples

Distributions. (corresponding to the cumulative distribution function for the discrete case).

A.7.1 Trigonometric interpretation of dot product A.7.2 Geometric interpretation of dot product

Section 5-4 Trigonometric Functions

6.2 Volumes of Revolution: The Disk Method

Euler Euler Everywhere Using the Euler-Lagrange Equation to Solve Calculus of Variation Problems

Graphs on Logarithmic and Semilogarithmic Paper

AREA OF A SURFACE OF REVOLUTION

6 Energy Methods And The Energy of Waves MATH 22C

Lectures 8 and 9 1 Rectangular waveguides

Treatment Spring Late Summer Fall Mean = 1.33 Mean = 4.88 Mean = 3.

Math 314, Homework Assignment Prove that two nonvertical lines are perpendicular if and only if the product of their slopes is 1.

Chapter. Contents: A Constructing decimal numbers

SPH simulation of fluid-structure interaction problems

The Velocity Factor of an Insulated Two-Wire Transmission Line

RIGHT TRIANGLES AND THE PYTHAGOREAN TRIPLETS

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

P.3 Polynomials and Factoring. P.3 an 1. Polynomial STUDY TIP. Example 1 Writing Polynomials in Standard Form. What you should learn

Lecture 25: More Rectangular Domains: Neumann Problems, mixed BC, and semi-infinite strip problems

Algebra Review. How well do you remember your algebra?

3 The Utility Maximization Problem

CUBIC-FOOT VOLUME OF A LOG

c b N/m 2 (0.120 m m 3 ), = J. W total = W a b + W b c 2.00

FUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation

** Dpt. Chemical Engineering, Kasetsart University, Bangkok 10900, Thailand

MATH 150 HOMEWORK 4 SOLUTIONS

CURVES ANDRÉ NEVES. that is, the curve α has finite length. v = p q p q. a i.e., the curve of smallest length connecting p to q is a straight line.

Vectors Recap of vectors

APPLICATION OF INTEGRALS

e.g. f(x) = x domain x 0 (cannot find the square root of negative values)

Applications to Physics and Engineering

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Module Summary Sheets. C3, Methods for Advanced Mathematics (Version B reference to new book) Topic 2: Natural Logarithms and Exponentials

Introduction to Integration Part 2: The Definite Integral

MODULE 3. 0, y = 0 for all y

The remaining two sides of the right triangle are called the legs of the right triangle.

The invention of line integrals is motivated by solving problems in fluid flow, forces, electricity and magnetism.

Exam 1 Study Guide. Differentiation and Anti-differentiation Rules from Calculus I

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2

Warm-up for Differential Calculus

How To Understand The Theory Of Inequlities

Harvard College. Math 21a: Multivariable Calculus Formula and Theorem Review

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001

2 DIODE CLIPPING and CLAMPING CIRCUITS

LECTURE #05. Learning Objectives. How does atomic packing factor change with different atom types? How do you calculate the density of a material?

Homework 3 Solutions

2.016 Hydrodynamics Prof. A.H. Techet

Simulation of operation modes of isochronous cyclotron by a new interative method

Small Business Cloud Services

Angles 2.1. Exercise Find the size of the lettered angles. Give reasons for your answers. a) b) c) Example

Second Term MAT2060B 1. Supplementary Notes 3 Interchange of Differentiation and Integration

Linear Equations in Two Variables

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

LECTURE #05. Learning Objective. To describe the geometry in and around a unit cell in terms of directions and planes.

Quick Guide to Lisp Implementation

The Definite Integral

Vectors. The magnitude of a vector is its length, which can be determined by Pythagoras Theorem. The magnitude of a is written as a.

19. The Fermat-Euler Prime Number Theorem

UNIVERSITY OF OSLO FACULTY OF MATHEMATICS AND NATURAL SCIENCES

Regular Sets and Expressions

Basically, logarithmic transformations ask, a number, to what power equals another number?

Helicopter Theme and Variations

Transcription:

Interpoltion, Smoothing, Extrpoltion A typicl numericl ppliction is to find smooth prmetriztion of ville dt so tht results t intermedite (or extended) positions cn e evluted. Wht is good estimte for y for x=4.5, or x=15? Options: if hve model, y=f(x), then fit the dt nd extrct model prmeters. Model then used to give vlues t other points. If no model ville, then use smooth function to interpolte Winter Semester 2006/7 Computtionl Physics I Lecture 3 1

Interpoltion Strt with interpoltion. Simplest - liner interpoltion. Imgine we hve two vlues of x, x nd x, nd vlues of y t these points, y, y. Then we interpolte (estimte the vlue of y t n intermedite point) s follows: y = y + (y y ) (x x ) (x x ) Winter Semester 2006/7 Computtionl Physics I Lecture 3 2

Interpoltion Bck to the initil plot: y = y + (y y ) (x x ) (x x ) Not very stisfying. Our intuition is tht functions should e smooth. Try reproducing with higher order polynomil. If we hve n+1 points, then we cn represent the dt with polynomil of order n. Winter Semester 2006/7 Computtionl Physics I Lecture 3 3

Interpoltion Fit with 10th order polynomil. We go through every dt point (11 free prmeters, 11 dt points). This gives smooth representtion of the dt nd indictes tht we re deling with n oscillting function. However, extrpoltion is dngerous! Winter Semester 2006/7 Computtionl Physics I Lecture 3 4

For n+1 points (x i,y i ), with Lgrnge Polynomils i = 0,1,,n x i x j i there is unique interpolting polynomil of degree n with p(x i ) = y i i = 0,1,,n Cn construct this polynomil using the Lgrnge polynomils, defined s: L i (x) = (x x 0 )(x x i1 )(x x i+1 )(x x n ) (x i x 0 )(x i x i1 )(x i x i+1 )(x i x n ) Degree n (denomintor is constnt), nd L i (x k ) = i,k Winter Semester 2006/7 Computtionl Physics I Lecture 3 5

Lgrnge Polynomils The Lgrnge Polynomils cn e used to form the interpolting polynomil: p(x) = n y i L i (x) = y i i=0 * * Exmple: 10th order polynomil Lgrnge=0. * Do I=0,10 term=1. Do k=0,10 If (k.ne.i) then term=term*(x-x0(k))/(x0(i)-x0(k)) Endif Enddo Lgrnge=Lgrnge+Y0(I)*term Enddo n i=0 n k =0,k i x x k x i x k Winter Semester 2006/7 Computtionl Physics I Lecture 3 6

Lgrnge Polynomils Error estimtion of the interpoltion/extrpoltion: Define err(x) = f (x) p(x) where f (x) is originl function, p(x) is interpolting function Choose x x i for ny i = 0,1,,n Now define F(x) = f (x) p(x) ( f (x) p(x) ) n i=0 n i=0 (x x i ) (x x i ) Now look t properties of F(x) Winter Semester 2006/7 Computtionl Physics I Lecture 3 7

Inter- nd Extrpoltion Error F(x i ) = 0 for ll i = 0,1,,n nd F(x) = 0. I.e., F(x) hs n + 2 zeroes Rolle's theorem: There exists etween x, x 0, x 1,, x n such tht F (n+1) () = 0 so, 0 = f (n+1) () ( f (x) p(x) ) n i=0 (n + 1)! (x x i ) ( p (n+1) = 0) ut x is ritrry, so e(x) = f (n+1) n () (x x i ) for some etween x, x 0, x 1,, x n (n + 1)! i=0 Winter Semester 2006/7 Computtionl Physics I Lecture 3 8

Inter- nd Extrpoltion Error Suppose we re trying to interpolte sine function (our exmple). We hve 11 dt points (n=10). Then f (n+1) (x) = d11 sin x dx 11 = cos x so f (n+1) () 1 e(x) n i=0 (x x i ) (n + 1)! ( )11 < 11! for interpoltion For extrpoltion, the error grows s the power (n+1) Winter Semester 2006/7 Computtionl Physics I Lecture 3 9

Splines Assume hve dt { x k, y k } with k = 0,n i.e., n + 1 points (lso known s knots) Define = x 0, = x n nd rrnge so tht x 0 < x 1 < < x n1 < x n A spline is polynomil interpoltion etween the dt points which stisfies the following conditions: 1. S(x) = S k (x) for x k x x k +1 k = 0,1,,n 1 2. S(x k ) = y k k = 0,1,,n 3. S k (x k +1 ) = S k +1 (x k +1 ) k = 0,1,,n 2 i.e., S(x) is continuous Winter Semester 2006/7 Computtionl Physics I Lecture 3 10

Splines Liner Spline: Qudrtic Spline: S k (x) = y k + y k +1 y k x k +1 x k (x x k ) S k (x) = y k + z k (x x k ) + z k +1 z k 2(x k +1 x k ) (x x k )2 z 0 hs to e fixed, for exmple from requiring S k () = z 0 = 0. then, z k +1 = z k + 2 y k +1 y k x k +1 x k Winter Semester 2006/7 Computtionl Physics I Lecture 3 11

Splines The cuic spline stisfies the following conditions: 1. S(x) = S k (x) for x k x x k +1 k = 0,1,,n 1 S k (x) = S k,0 + S k,1 (x x k ) + S k,2 (x x k ) 2 + S k,3 (x x k ) 3 2. S(x k ) = y k k = 0,1,,n 3. S k (x k +1 ) = S k +1 (x k +1 ) k = 0,1,,n 2 i.e., S(x) is continuous 4. S k (x k +1 ) = S k +1 (x k +1 ) k = 0,1,,n 2 i.e., S (x) is continuous 5. S k (x k +1 ) = S k +1 (x k +1 ) k = 0,1,,n 2 i.e., S (x) is continuous Winter Semester 2006/7 Computtionl Physics I Lecture 3 12

Splines Need t lest 3rd order polynomil to stisfy the conditions. Numer of prmeters is 4n. Fixing S k (x k )=y k gives n+1 conditions. Fixing S k (x k+1 )=S k+1 (x k+1 ) gives n dditionl n-1 conditions. Mtching the first nd second derivtive gives nother 2n-2 conditions, for totl of 4n-2 conditions. Two more conditions re needed to specify unique cuic spline which stisfies the conditions on the previous pge: S () = 0 S () = 0 Nturl cuic spline Cn tke other options for the oundry conditions Winter Semester 2006/7 Computtionl Physics I Lecture 3 13

Liner spline Splines Cuic spline Qudrtic spline Winter Semester 2006/7 Computtionl Physics I Lecture 3 14

Cuic Splines The cuic spline is optiml in the following sense: 1. It is ccurte to fourth order, nd f(x)-s(x) 5 384 mx f ( 4) (x) h 4 where h = mx k x k +1 x k x 2. It is the minimum curvture function linking the set of dt points. Cuic spline stisfies Curvture is defined s [ S (x) ] 2 dx f (x) [ ] 2 Winter Semester 2006/7 Computtionl Physics I Lecture 3 15 f (x) ( 1 + f (x) 2 ) 3/2 dx f (x) Any smooth interpolting function must hve curvture t lest s lrge s cuic spline

Cuic Splines Proof of 2. Strt with lgeric identity F 2 S 2 = (F S) 2 2S(S F) Let F = f (x), S = S (x) then [ f (x) ] 2 dx [ S (x) ] 2 dx = [ f (x) S (x) ] 2 dx 2 S (x) [ S (x) f (x) ] dx [ f (x) S (x) ] 2 dx 0 S (x) [ S (x) f (x) ] dx = S (x) [ S (x) f (x) ] dx n1 k =0 x k+1 x k Now we use integrtion y prts to solve the integrls Winter Semester 2006/7 Computtionl Physics I Lecture 3 16

Cuic Splines Recll: u(x) v (x)dx = u(x)v(x) u (x)v(x)dx n1 x S (x) ( S (x) f (x) k+1 x ) dx = S (x) ( S (x) f (x) ) k+1 xk S (x) ( S (x) f (x) ) dx k =0 The first term is n1 S (x) S (x) f (x) x k+1 = S () ( S () f () ) S () ( S () f () ) k =0 ( ) xk = 0 From the oundry conditions for nturl cuic spline S (x) is constnt (since we hve cuic) nd cn e tken out of the integrl, so ( ) S (x) S (x) f (x) dx = S k ut since S(x k ) = f (x k ), = 0 n1 k =0 n1 S k k =0 x k+1 x k ( S (x) f (x) ) dx = ( S(x) f (x)) xk x k+1 x k Winter Semester 2006/7 Computtionl Physics I Lecture 3 17

Cuic Splines [ f (x) ] 2 dx [ S (x) ] 2 dx 0 We hve proven tht cuic spline hs smller or equl curvture thn ny function which fulfills the interpoltion requirements. This lso includes the function we strted with. Physicl interprettion: clmped flexile rod picks the minimum curvture to minimize energy - spline Winter Semester 2006/7 Computtionl Physics I Lecture 3 18

Dt Smoothing If we hve lrge numer of dt points, interpoltion with polynomils, splines, etc is very costly in time nd multiplies the numer of dt. Smoothing (or dt fitting) is wy of reducing. In smoothing, we just wnt prmetriztion which hs no model ssocited to it. In fitting, we hve model in mind nd try to extrct the prmeters. Dt fitting is full semester topic of its own. A few rief words on smoothing of dt set. The simplest pproch is to find generl function with free prmeters which cn e djusted to give the est representtion of the dt. The prmeters re optimized y minimizing chi squred: 2 = n i=0 (y i f (x i ; )) 2 w i 2 Winter Semester 2006/7 Computtionl Physics I Lecture 3 19

2 = Dt Smoothing n i=0 (y i f (x i ; )) 2 w i 2 re the prmeters of the function to e fit y i re the mesured points t vlues x i w i is the weight given to point i In our exmple, let s tke f (x; A,) = Acos(x + ) And set w i = 1 i Now we minimize 2 s function of A nd Winter Semester 2006/7 Computtionl Physics I Lecture 3 20

Dt Smoothing Best fit for A=1, =3/2 Acos(x + ) = 1 cos(x + 3 /2)= cos x cos 3 /2 sin xsin 3 /2= sin x Winter Semester 2006/7 Computtionl Physics I Lecture 3 21

Exercises 1. Clculte the Lgrnge Polynomil for the following dt: x 0 0.5 1. 2. y 1 0.368 0.135 0.018 2. For the sme dt, find the nturl cuic spline coefficients. Plot the dt, the lgrnge polynomil nd the cuic spline interpoltions. 3. Smooth the dt in the tle with the function f(x)=aexp(-x). Wht did you get for A,? Winter Semester 2006/7 Computtionl Physics I Lecture 3 22