Curve Fitting. Objectives

Similar documents
Curve Fitting and Interpolation

Newton's forward interpolation formula

Q1. Discuss, compare and contrast various curve fitting and interpolation methods

CHAPTER 4 ROOTS OF EQUATIONS

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Input: A set (x i -yy i ) data. Output: Function value at arbitrary point x. What for x = 1.2?

BSM510 Numerical Analysis

Least squares regression

1.1 GRAPHS AND LINEAR FUNCTIONS

UNIT-II INTERPOLATION & APPROXIMATION

Interpolation Theory

Introduction Linear system Nonlinear equation Interpolation

Quantitative Techniques (Finance) 203. Polynomial Functions

Newton s Method and Linear Approximations

Numerical Methods. Roots of Equations

Q 0 x if x 0 x x 1. S 1 x if x 1 x x 2. i 0,1,...,n 1, and L x L n 1 x if x n 1 x x n

Newton s Method and Linear Approximations

CHAPTER 2 POLYNOMIALS KEY POINTS

A VERTICAL LOOK AT KEY CONCEPTS AND PROCEDURES ALGEBRA I

Newton s Method and Linear Approximations 10/19/2011

Chapter 3: Root Finding. September 26, 2005

November 20, Interpolation, Extrapolation & Polynomial Approximation

SYSTEMS OF NONLINEAR EQUATIONS

PLC Papers. Created For:

SKILL BUILDER TEN. Graphs of Linear Equations with Two Variables. If x = 2 then y = = = 7 and (2, 7) is a solution.

PDE: The Method of Characteristics Page 1

Engineering 7: Introduction to computer programming for scientists and engineers

Scientific Computing

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines

Results and Analysis 10/4/2012. EE145L Lab 1, Linear Regression

Section 5.8 Regression/Least Squares Approximation

Computational Methods CMSC/AMSC/MAPL 460. Solving nonlinear equations and zero finding. Finding zeroes of functions

Interpolation APPLIED PROBLEMS. Reading Between the Lines FLY ROCKET FLY, FLY ROCKET FLY WHAT IS INTERPOLATION? Figure Interpolation of discrete data.

Titration of a Monoprotic Weak Acid with the Strong Base, NaOH

6x 2 8x + 5 ) = 12x 8. f (x) ) = d (12x 8) = 12

Downloaded from

CHAPTER-II ROOTS OF EQUATIONS

AP Calculus Worksheet: Chapter 2 Review Part I

The degree of a function is the highest exponent in the expression

Nonlinear Equations. Your nonlinearity confuses me.

x is also called the abscissa y is also called the ordinate "If you can create a t-table, you can graph anything!"

Non-linear least squares

Experiment 2. F r e e F a l l

Chapter 2. Motion in One Dimension. AIT AP Physics C

Interpolation and polynomial approximation Interpolation

Curriculum Area: Mathematics A Level - 2 year course (AQA) Year: 12. Aspire Learn Achieve

In practice one often meets a situation where the function of interest, f(x), is only represented by a discrete set of tabulated points,

Differentiation of Discrete Functions

Precalculus Summer Assignment 2015

Triangular Plate Displacement Elements

MEI STRUCTURED MATHEMATICS CONCEPTS FOR ADVANCED MATHEMATICS, C2. Practice Paper C2-C

Computational Methods. Solving Equations

function independent dependent domain range graph of the function The Vertical Line Test

P.7 Solving Inequalities Algebraically and Graphically

6x 2 8x + 5 ) = 12x 8

5. Polynomial Functions and Equations

DATA IN SERIES AND TIME I. Several different techniques depending on data and what one wants to do

2.3. Polynomial Equations. How are roots, x-intercepts, and zeros related?

Solution of Algebric & Transcendental Equations

CCSS TRADITIONAL PATHWAY ALGEBRA I CONTENT MAP

8 th Grade Essential Learnings

A VERTICAL LOOK AT KEY CONCEPTS AND PROCEDURES ALGEBRA I. Texas Education Agency

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation

Algebra 1 Khan Academy Video Correlations By SpringBoard Activity and Learning Target

Numerical Methods. Lecture Notes #08 Discrete Least Square Approximation

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2.

FLORIDA STANDARDS TO BOOK CORRELATION

Numerical Marine Hydrodynamics

DEPARTMENT OF MATHEMATICS

Accelerated Advanced Algebra. Chapter 1 Patterns and Recursion Homework List and Objectives

GENG2140, S2, 2012 Week 7: Curve fitting

Least-Squares Regression

New Material Section 1: Functions and Geometry occurring in engineering

MR. YATES. Vocabulary. Quadratic Cubic Monomial Binomial Trinomial Term Leading Term Leading Coefficient

x and y, called the coordinates of the point.

TABLE OF CONTENTS 2 CHAPTER 1

Appendix F. Steam Tables

2014 Summer Review for Students Entering Algebra 2. TI-84 Plus Graphing Calculator is required for this course.

Solutions 2. January 23, x x

MATH 1372, SECTION 33, MIDTERM 3 REVIEW ANSWERS

S56 (5.1) Polynomials.notebook August 25, 2016

Standards for Mathematical Practice. Number and Quantity. Rewrite algebraic expressions with integer exponents using the properties of exponents.

Grade 8. Concepts and Procedures. The Number System. Expressions and Equations

Simple Linear Regression

Solving Non-Linear Equations (Root Finding)

Regression Models - Introduction

The Standard Atmosphere

Algebra vocabulary CARD SETS Frame Clip Art by Pixels & Ice Cream

COMMON CORE STATE STANDARDS TO BOOK CORRELATION

Maria Cameron Theoretical foundations. Let. be a partition of the interval [a, b].

Interpolation and Polynomial Approximation I

Global polynomial interpolants suffer from the Runge Phenomenon if the data sites (nodes) are not chosen correctly.

Rearrange m ore complicated formulae where the subject may appear twice or as a power (A*) Rearrange a formula where the subject appears twice (A)

Power Series Solutions We use power series to solve second order differential equations

Chapter 4: Interpolation and Approximation. October 28, 2005

Numerical Analysis Fall. Roots: Open Methods

Newton s Laws of Motion

AP Calculus 2004 AB (Form B) FRQ Solutions

1 Piecewise Cubic Interpolation

ME 201 Thermodynamics

Transcription:

Curve Fitting Objectives Understanding the difference between regression and interpolation. Knowing how to fit curve of discrete with least-squares regression. Knowing how to compute and understand the meaning of the coefficient of determination. Knowing how to perform an interpolation with Newton s polynomial. In engineering problem, sometime we would like to find the relationships of variables in the form of mathematical models (mathematical equations). It is convenient to predict the change of dependent variables when independent variables vary by using the mathematical models. The mathematical models can be derived not only from laws and theory but also from experimental data which is often given for discrete values. To determine the continuous formulation of those values, we can apply the curve fitting techniques to such data. Fig.1 Example of discrete data.

There are two general approaches for curve fitting: 1. Regression a technique of representing the general trend of the data using a single curve. This curve may not need to intersect all data points. While, the curve shows the pattern of a group of data points. 2. Interpolation a technique of fitting a curve or a series of curve that pass through each of data points. The curve needs to intersect all data points. Fig. 2 Comparison between Regression and Interpolation 1. Polynomial Least-Squares Regression 1.1. Linear Least-Squares Regression The simplest trend curve for curve fitting is a linear line. Fig. 3 The graphical example of linear curve fitting. Y ( a a X) 0 1

However, The difference between the predicted value (by curve fitting) and the data point is existed. The difference is considered as error. A residual error can be derived from e y ( a a x) (1) 0 1 Where e = the residual error y = the true value of data point a a x = the approximate predicted by the linear equation 0 1 The sum of residual errors can be expressed as n n e ( y ( a a x)) i i1 i1 0 1 And the sum squares of the residuals is given by r n n 2 2 i ( ( 0 1 )) i1 i1 S e y a a x The best line which represents the trend of the data must be a line with the minimum sum squares of the residuals. (2) (3) To complete the linear equation, we need to determine a 0 and a 1 by taking the derivative of have Sr with respect to each unknown ( a 0 and a 1 ). Then, we S a r 0 n i1 2 y a a x i 0 1 i (4) S r a 1 n i1 2 yi a0 a1xi xi (5)

When the Thus, Sr is expected to be minimum as zero, its derivatives equal to zero. n n n 0 y a a x i 0 1 i i1 i1 i1 (6) n n n 2 xi yi a0xi a1xi i1 i1 i1 0 (7) Where a0 na0. Eq. (6) and (7) can be rearranged as n n na0 xia1 y i1 i1 n n n 2 xi a0 xi a1 xi yi i1 i1 i1 i (8) (9) These equations can be solved for a 0 and a1 as a n n n n x y x y i i i i i1 i1 i1 1 2 n n 2 n xi xi i1 i1, (10) a y a x 0 1 (11)

Example 1 Fit a straight line to the values in the following table.

The coefficient of determination, r 2 The r2 is used to measure the goodness of curve fitting. It is given by r S S S 2 t r t `(12) Where S t = Total sum of square which is the square of the difference between an individual data point and the mean of the data. S r = the sum squares of the residuals.

Example 2 Determine the coefficient of determination for the curve fitting in Example 1

1.2. General Polynomial Regression The least-squares procedure can be extended to fit the data to a higher-order polynomial. For example, using the second-order polynomial or quadratic: Fig. 4 (a) a linear regression and (b) a second-order polynomial regression. y a a x a x 0 1 2 In this case, the sum of squares of residuals is 2 (13) n n 2 2 2 r i i 0 1 i 2 i i1 i1 S e y a a x a x To generate the least-squares fit, the derivatives of the sum of squares of residuals with respect to each unknown coefficients of the polynomial is expressed as (14)

S a r 0 S a r 1 S a r 2 2 i 0 1 i 2 i 2 y a a x a x 2 i i 0 1 i 2 i 2 x y a a x a x 2 2 i i 0 1 i 2 i 2 x y a a x a x These three equations are set to be zero to minimize the error of prediction. Thus, the equations can be rearranged in the form of the system of equations: (15) na x a x a y n n n 2 0 i 1 i 2 i i1 i1 i1 n n n n 2 3 xi a0 xi a1 xi a2 xi yi i1 i1 i1 i1 n n n n 2 3 4 2 xi a0 xi a1 xi a2 xi yi i1 i1 i1 i1 (16) Example 3 Fit a second-order polynomial to the following data x 0 1 2 3 4 5 y 2.1 7.7 13.6 27.2 40.9 61.1

2. Newton s Interpolation An interpolation is a technique that can determine the equations for line connecting the adjacent values. It is also used for estimate the unknown valves in between the data points. Fig. 5 (a) Linear interpolation, (b) quadratic, and (c) cubic interpolations 2.1. Linear Interpolation The simplest form of interpolation is to connect two data points with a straight line.

Fig. 6 The concept of linear interpolation Using similar triangles, the slopes of the line are expressed as slope f1( x) f ( x1) f ( x 2) f ( x1) x x x x 1 2 1 (17) f ( x 2) f ( x1) f1( x) f ( x1) ( x x1) x x 2 1 (18) f ( x) C C ( x x ) 1 1 2 1 (19) Eq. (18) and (19) are the Newton linear-interpolation formula. The notation denotes a first-order interpolating polynomial. f1 x Example 4 Estimate f (3) of the following data using a linear Newton s interpolation.

x f(x) 1 0 4 1.386 6 1.792 7 1.609...... 2.2. General Form of Newton s Interpolating Polynomials To fit an (n-1)th-order polynomial to the n data points, the (n-1)th-order polynomial is f ( x) b b ( x x ) b ( x x )( x x ) ( x x ) (20) n1 1 2 1 n 1 2 n1 Where the coefficients b 1 b 2,,, n in a linear interpolation. Thus, we have b can be evaluated using the similar scheme as b f ( x ) (21) 1 1 b f [ x, x ] (22) 2 2 1 b f [ x, x, x ] (23) 3 3 2 1 b f [ x, x,, x, x ] (24) 3 n n1 2 1

Where the bracket function can be evaluated using finite divided differences. f [ x, x ] i j i j f x f x x i x (25) j f [ x, x, x ] i j k f [ xi, x j ] f [ x j, xk ] x x (26) i k f [ xn, xn1,, x2] f [ xn1, xn2,, x1] f [ xn, xn1,, x2, x1] x x (27) n 1 Fig. 6 A divided difference table For example, the quadratic interpolation, the second-order polynomial is f ( x) b b ( x x ) b ( x x )( x x ) (28) 2 1 2 1 3 1 2 Where the coefficients are evaluated by b f ( x ) (29) 1 1

b f [ x, x ] 2 2 1 b f [ x, x, x ] 3 3 2 1 f ( x2) f ( x1) x x (30) 2 1 f ( x3) f ( x3) f ( x2) f ( x1) x3 x2 x2 x1 x x (31) 3 1 Example 5 Use a second-order Newton polynomial to create the quadratic interpolation formulation of the following data. x f(x) 1 0 4 1.386 6 1.792

Example 6 (a) Fit a straight line to the values in the following table. (b) And estimate f (3.6) using linear Newton s Interpolation. x 1 2 3 5 6 f(x) 4.75 4 5.25 19.75 36.

... Exercises 1. The acceleration due to gravity at an altitude y above the surface of the earth is given by y [m] 0 20,000 40,000 60,000 80,000 g [m/s 2 ] 9.8100 9.7487 9.6879 9.6278 9.5682 Use linear regression to formulate a linear function of the above data 2. Fit a quadratic polynomial to the following data and evaluate the r 2 for the curve fitting. x 3 4 5 7 8 9 11 12 y 1.6 3.6 4.4 3.4 2.2 2.8 3.8 4.6 3. Use the portion of the given steam table for superheated water at 200 MPa to find

(a) The corresponding entropy, s, for a specific volume, v, of 0.118 with linear interpolation, (b) The same corresponding entropy using quadratic interpolation. (c) The volume corresponding to an entropy of 6.45 using linear interpolation. v [m3/kg] 0.10377 0.11144 0.12547 s [kj/kg.k] 6.4147 6.5453 6.7664