Curve Fitting and Interpolation: Lecture (I)

Slides:



Advertisements
Similar presentations
Splines and Piecewise Interpolation
Advertisements

Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Curve Fitting ~ Least Squares Regression Chapter.
Chapter 18 Interpolation The Islamic University of Gaza
Computational Methods in Physics PHYS 3437
ES 240: Scientific and Engineering Computation. InterpolationPolynomial  Definition –a function f(x) that can be written as a finite series of power functions.
Numerical Integration Lecture (II)1
KFUPM SE301: Numerical Methods Topic 5: Interpolation Lectures 20-22:
Dr. Jie Zou PHY Chapter 2 Solution of Nonlinear Equations: Lecture (III)
Curve-Fitting Interpolation
Curve Fitting and Interpolation: Lecture (IV)
Function Approximation
Curve-Fitting Polynomial Interpolation
Dr. Jie Zou PHY Chapter 3 Solution of Simultaneous Linear Algebraic Equations: Lecture (II) Note: Besides the main textbook, also see Ref: Applied.
Polynomial Interpolation
Dr. Jie Zou PHY Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (II) 1 1 Besides the main textbook, also see Ref.: “Applied.
Solution of Nonlinear Equations: Lecture (I)
Curve Fitting and Interpolation: Lecture (II)
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 22 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW III.
Dr. Jie Zou PHY Chapter 3 Solution of Simultaneous Linear Algebraic Equations: Lecture (III) Note: Besides the main textbook, also see Ref: Applied.
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.
Numerical Integration Lecture (I)1
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
Dr. Jie Zou PHY Chapter 7 Numerical Differentiation: 1 Lecture (I) 1 Ref: “Applied Numerical Methods with MATLAB for Engineers and Scientists”, Steven.
Lagrange interpolation Gives the same results as Newton, but different method.
Chapter 6 Numerical Interpolation
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 21 CURVE FITTING Chapter 18 Function Interpolation and Approximation.
Numerical Differentiation:1* Lecture (II)
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
8/15/ Differentiation-Discrete Functions Major: All Engineering Majors Authors: Autar Kaw, Sri Harsha Garapati.
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)
1 Chapter 7 NUMERICAL INTEGRATION. 2 PRELIMINARIES We use numerical integration when the function f(x) may not be integrable in closed form or even in.
Simpson Rule For Integration.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Curve Fitting.
Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
1 Interpolation. 2 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a.
Curve Fitting and Regression EEE 244. Descriptive Statistics in MATLAB MATLAB has several built-in commands to compute and display descriptive statistics.
Part 4 Chapter 17 Polynomial Interpolation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The McGraw-Hill.
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.
Numerical Methods For Slides Thanks to Lecture 6 Interpolation
Interpolation produces a function that matches the given data exactly. The function then can be utilized to approximate the data values at intermediate.
Lecture 16 - Approximation Methods CVEN 302 July 15, 2002.
Dr. Jie Zou PHY Chapter 2 Solution of Nonlinear Equations: Lecture (II)
1 INTERPOLASI. Direct Method of Interpolation 3 What is Interpolation ? Given (x 0,y 0 ), (x 1,y 1 ), …… (x n,y n ), find the value of ‘y’ at a value.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 4 Chapter 15 General Least Squares and Non- Linear.
Principles of Extrapolation
Curve Fitting Introduction Least-Squares Regression Linear Regression Polynomial Regression Multiple Linear Regression Today’s class Numerical Methods.
Interpolation - Introduction
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Applied Numerical Methods With MATLAB ® for Engineers.
11/22/ Differentiation-Discrete Functions.
Polynomial Interpolation
Numerical Analysis Lecture 25.
Interpolation.
Differentiation-Discrete Functions
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.
Differentiation-Discrete Functions
Reading Between the Lines
Chapter 18.
INTERPOLATION Prof. Samuel Okolie, Prof. Yinka Adekunle & Dr
MATH 2140 Numerical Methods
POLYNOMIAL INTERPOLATION
INTERPOLASI.
Simultaneous Linear Equations
5.2B Graphing Polynomial Functions
Presentation transcript:

Curve Fitting and Interpolation: Lecture (I) Chapter 5 Curve Fitting and Interpolation: Lecture (I) Dr. Jie Zou PHY 3320

Outline Introduction Engineering applications Curve Fitting? Interpolation? Engineering applications Measurement of damping in a fluid Measurement of the dependence of air resistance on velocity in a wind tunnel experiment Collocation-Polynomial fit Interpolation (1) Lagrange interpolation formula Dr. Jie Zou PHY 3320

Introduction Curve fitting? – To fit a smooth and continuous function (curve) to the available discrete data. A familiar example: In the Free-fall lab in General Physics I, you are asked to fit a function (quadratic) to the data of position v.s. time. Two approaches: Collocation: The approximating function passes through all the data points. Usually used when the data are known to be accurate. Least-square regression: The approximating curve represents the general trend of the data. Usually used when the data appear to have significant error. Figure 5.1 Collocation-Fitting polynomials Dr. Jie Zou PHY 3320

Introduction (cont.) Interpolation? – The process of estimating an intermediate value from a set of discrete (or tabulated) values. The collocation function is often called an interpolating function. Polynomial interpolation is most commonly used. Others: trigonometric or exponential function. Different forms of Polynomial interpolation Lagrange interpolation-Lecture (I) Newton forward or backward interpolation-Lecture (II) Dr. Jie Zou PHY 3320

Engineering applications Example 5.1: An experiment to measure the damping of a solid body in a fluid. Dr. Jie Zou PHY 3320

Available Data Points t (s) 0.0 1.5 3.7 5.2 7.1 9.6 11.8  (deg) 110.0 77.5 44.7 31.5 20.1 11.6 7.0 Assuming an exponential function to fit the data: (t) = a ebt. Determine a and b use certain curve fitting technique. Dr. Jie Zou PHY 3320

Engineering applications (cont.) Wind tunnel experiment to measure how the force of air resistance depends on velocity. Dr. Jie Zou PHY 3320

Available Data Points Assuming a polynomial quadratic fit: Fu = cdv2. v (m/s) 10 20 30 40 50 60 70 80 F (N) 25 380 550 610 1220 830 1450 Assuming a polynomial quadratic fit: Fu = cdv2. Determine cd use certain curve fitting technique Dr. Jie Zou PHY 3320

Collocation-Polynomial Fit Available data points: (xi,yi), i=0,1,2, ,n. Consider a polynomial of order n: f(x)=y=a0+a1x+a2x2++an-1xn-1+anxn. Let the polynomial passes through all the points (xi,yi); a system of (n+1) linear algebraic equations; (n+1) unknown coefficients a0, a1, ,an: yi=a0+a1xi+a2xi2++an-1xin-1+anxin, i=0,1,2, ,n. The matrix form: [B]a=y, where We can use Gauss Elimination to solve for ai’s. Dr. Jie Zou PHY 3320

Example 5.4 The data on the voltage e (V) v.s. time t (s) in an circuit are given by the following: t = 0, 0.005 s, and 0.01 s; e = 0, 110 V, and 0 V. Choose a polynomial to exactly fit the data. (1) Find the coefficients using MATLAB built-in functions (code) (2) Find the coefficients using Gauss Elimination (Code) (3) Plot both the discrete data points and the polynomial fitting function on the same graph. (4) Check if the fitting curve pass through all the date points. Dr. Jie Zou PHY 3320

Interpolation-(1) Lagrange Interpolation Formula Example: Three data points (xi, yi), i=0,1,2. Basic idea: Express the polynomial in an alternative way f(x)=y=a0(x-x1)(x-x2) +a1(x-x0)(x-x2) +a2(x-x0)(x-x1) Set f(xi) = yi, we have y0 =a0(x0-x1)(x0-x2), y1=a1(x1-x0)(x1-x2), and y2 = a2(x2-x0)(x2-x1) Easy Solution for ai, i=0,1,2 (see next slide). Dr. Jie Zou PHY 3320

Lagrange Interpolation Formula (cont.) Dr. Jie Zou PHY 3320

Example 5.5 (a) Develop a Lagrange interpolation polynomial that passes through the points (0,0), (0.005,110), and (0.01,0). (b) Evaluate the function at an intermediate point x = 0.0025 or 2.5x10-3. (1) By hand. (2) Write an M-file MyLagrange.m. A copy of the code will be handed out later. Dr. Jie Zou PHY 3320