COT4501 Spring Homework VI

Similar documents
Natural cubic splines

1 Review of Least Squares Solutions to Overdetermined Systems

the points are called control points approximating curve

Indiana State Core Curriculum Standards updated 2009 Algebra I

Partial Fractions. Combining fractions over a common denominator is a familiar operation from algebra:

Piecewise Cubic Splines

4.3 Lagrange Approximation

Alum Rock Elementary Union School District Algebra I Study Guide for Benchmark III

POLYNOMIAL FUNCTIONS

1 Cubic Hermite Spline Interpolation

The Method of Least Squares. Lectures INF2320 p. 1/80

(Refer Slide Time: 1:42)

Solving Quadratic Equations

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

Integrals of Rational Functions

November 16, Interpolation, Extrapolation & Polynomial Approximation

Corollary. (f є C n+1 [a,b]). Proof: This follows directly from the preceding theorem using the inequality

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

Name Intro to Algebra 2. Unit 1: Polynomials and Factoring

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

1.3 Algebraic Expressions

3.3. Solving Polynomial Equations. Introduction. Prerequisites. Learning Outcomes

Answer Key for California State Standards: Algebra I

CHAPTER 1 Splines and B-splines an Introduction

AN INTRODUCTION TO NUMERICAL METHODS AND ANALYSIS

1 Review of Newton Polynomials

The Method of Partial Fractions Math 121 Calculus II Spring 2015

3.1. RATIONAL EXPRESSIONS

Lagrange Interpolation is a method of fitting an equation to a set of points that functions well when there are few points given.

Numerical Analysis An Introduction

3.2. Solving quadratic equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

Second Order Linear Nonhomogeneous Differential Equations; Method of Undetermined Coefficients. y + p(t) y + q(t) y = g(t), g(t) 0.

6.1 Add & Subtract Polynomial Expression & Functions

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

Algebra I Vocabulary Cards

LAB 11: MATRICES, SYSTEMS OF EQUATIONS and POLYNOMIAL MODELING

Zero: If P is a polynomial and if c is a number such that P (c) = 0 then c is a zero of P.

Increasing for all. Convex for all. ( ) Increasing for all (remember that the log function is only defined for ). ( ) Concave for all.

PYTHAGOREAN TRIPLES KEITH CONRAD

Trend and Seasonal Components

Algebra I. In this technological age, mathematics is more important than ever. When students

Algebra 2 Chapter 1 Vocabulary. identity - A statement that equates two equivalent expressions.

Vocabulary Words and Definitions for Algebra

DRAFT. Further mathematics. GCE AS and A level subject content

ROUTH S STABILITY CRITERION

Definitions 1. A factor of integer is an integer that will divide the given integer evenly (with no remainder).

Lecture 3: Finding integer solutions to systems of linear equations

10.1. Solving Quadratic Equations. Investigation: Rocket Science CONDENSED

INTERPOLATION. Interpolation is a process of finding a formula (often a polynomial) whose graph will pass through a given set of points (x, y).

Mean value theorem, Taylors Theorem, Maxima and Minima.

SECTION 0.6: POLYNOMIAL, RATIONAL, AND ALGEBRAIC EXPRESSIONS

Higher Education Math Placement

Mathematics Online Instructional Materials Correlation to the 2009 Algebra I Standards of Learning and Curriculum Framework

1 Shapes of Cubic Functions

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives

expression is written horizontally. The Last terms ((2)( 4)) because they are the last terms of the two polynomials. This is called the FOIL method.

Algebra 1 Course Title

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

Polynomial Degree and Finite Differences

Algebra 1 Course Information

ab = c a If the coefficients a,b and c are real then either α and β are real or α and β are complex conjugates

Algebra and Geometry Review (61 topics, no due date)

Efficient Curve Fitting Techniques

Applied Linear Algebra I Review page 1

NSM100 Introduction to Algebra Chapter 5 Notes Factoring

Numerical integration of a function known only through data points

CRLS Mathematics Department Algebra I Curriculum Map/Pacing Guide

Finite Element Formulation for Plates - Handout 3 -

Figure 2.1: Center of mass of four points.

a 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4)

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

6.4 Factoring Polynomials

0.4 FACTORING POLYNOMIALS

Core Maths C1. Revision Notes

Chapter 4 -- Decimals

Basics of Polynomial Theory

MATH Fundamental Mathematics IV

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

Determinants can be used to solve a linear system of equations using Cramer s Rule.

SUNY ECC. ACCUPLACER Preparation Workshop. Algebra Skills

Integer roots of quadratic and cubic polynomials with integer coefficients

Successful completion of Math 7 or Algebra Readiness along with teacher recommendation.

Method To Solve Linear, Polynomial, or Absolute Value Inequalities:

Tim Kerins. Leaving Certificate Honours Maths - Algebra. Tim Kerins. the date

Course Outlines. 1. Name of the Course: Algebra I (Standard, College Prep, Honors) Course Description: ALGEBRA I STANDARD (1 Credit)

Zeros of a Polynomial Function

Zeros of Polynomial Functions

Math 1. Month Essential Questions Concepts/Skills/Standards Content Assessment Areas of Interaction

Roots of Polynomials

3. Interpolation. Closing the Gaps of Discretization... Beyond Polynomials

1.6 A LIBRARY OF PARENT FUNCTIONS. Copyright Cengage Learning. All rights reserved.

is identically equal to x 2 +3x +2

Zeros of Polynomial Functions

Prentice Hall. California Edition of Algebra 1 - Classics Edition (Smith/Charles) Grade 8

Notes on Determinant

Numerical Analysis Lecture Notes

Solving Rational Equations

Curve Fitting with Maple

1) (-3) + (-6) = 2) (2) + (-5) = 3) (-7) + (-1) = 4) (-3) - (-6) = 5) (+2) - (+5) = 6) (-7) - (-4) = 7) (5)(-4) = 8) (-3)(-6) = 9) (-1)(2) =

Transcription:

COT450 Spring 0 Homework VI This assignment has seven problems. The assignment is due in class on Tuesday, April 0, 0. There are seven regular problems and two computer problems (using MATLAB). For written problems, you need to show your work and it is insufficient to just give the results or answers. For the computer problems, turn in your results (e.g., graphs, plots, simple analysis and so on) and also a printout of your (MATLAB) code. Problem (5pts). What is the basic distinction between interpolation and approximation of a function?. Is Interpolation an appropriate procedure for fitting a function to noisy data? If so, why? and if not, what is a good alternative? 3. (a) For a given set of data points (t i, y i ), i =,..., n, rank the following three methods for polynomial interpolation according to the cost of determining the interpolant (i.e., determining the coefficients of the basis functions), from for the cheapest to 3 for the most expensive: Monomial basis, Lagrange Basis and Newton basis. (b) Which of the three methods has the best-conditioned basis matrix A? (c) For which of the three methods is evaluating the resulting interpolant at a given point the most expensive? 4. Why is interpolation by a polynomial of high degree often unsatisfactory? 5. In fitting a large number of data points, what is the main advantage of piecewise polynomial interpolation over interpolation by a single polynomial?. In approximation, function could be close to the points and not necessarily passes through those points. Interpolating function fits given data exactly.. Interpolation is inappropriate, least squares approximation should be used. 3. (a) Monomial basis (3), Newton basis(), Lagrange basis () (b) Newton (c) Lagrange 4. it s expansive to determine and evaluate. In some bases, coefficients of polynomial may be poorly determined due to ill-conditioning of linear system to be solved. High degree polynomial necessarily has lots of wiggles which may bear no relation to the data to be fit. Polynomial may pass through required data point, but it may oscillate wildly between data points

5. large number of data points can be fit with low-degree polynomials. Problem (5pts). How many times is a Hermite cubic interpolant continuously differentiable?. How many times is a cubic spline interpolant continuously differentiable? 3. For Lagrange polynomial interpolation of n data points (t i, y i ), i =,..., n,. once. twice (a) What is the degree of each polynomial function l j (t) in the Lagrange basis? (b) What function results if we sum the n functions in the Lagrange basis (i.e., if we take g(t) = l (t) +... + l n (t), what function g(t) results)? 3. (a) n- (b) one. The proof is quite simple. g(t) = l (t) +... + l n (t) could be taken as interpolating zeroth order polynomial (constant function) with value i.e. y i =. As the interpolating polynomial is unique (property of Polynomial Interpolation, since there are n data points and degree is n ) therefore g(t) = implying summation is. Problem 3 (5pts) Given the three data points (, ), (0, 0), (, ), determine the interpolating polynomial of degree two:. Using the monomial basis. Using the Lagrange basis 3. Using the Newton basis Show that the three representations give the same polynomial.. The linear system using the monomial basis is x 0 0 x x 3 = 0 () Solving this system by Gaussian elimination, we obtain x = [00] T so the interpolating polynomial is p(t) = t.

. The form of a polynomial of degree two using the Lagrange basis is (t t )(t t 3 ) p(t) = y (t t )(t t 3 ) + y (t t )(t t 3 ) (t t )(t t 3 ) + y (t t )(t t ) 3 (t 3 t )(t 3 t ) substituting the data for this problem, the polynomial becomes (t 0)(t ) p(t) = ( 0)( ) t(t ) p(t) = + which is equivalent to the polynomial in part 3. The linear system using the Newton basis is 0 0 x 0 x x 3 (t + )(t ) (t + )(t 0) + 0 + (0 + )(0 ) ( + )( 0) t(t + ) = 0 () Solving this system by forward substitution, we obtain x = [ ] T so the interpolating polynomial is p(t) = (t + ) + (t + t. Which is equivalent to the polynomial in first part Problem 4 (5pts) How many multiplications are required to evaluate a polynomial p(t) of degree n at a given point t. represented in the monomial basis?. represented in the Lagrange basis? 3. represented in the Newton basis?. Without Horner s method,p n (t) = x n t n + x n t n +... + x. It 4 k is computer from scratch at each step, then it takes (n )(n ) multiplications to computer t k and n multiplications by the x k, for a total of n multiplications. If tk is computed inductively using t k from previous step, then it takes n multiplications to compute t n and n multiplications by the x k for a total of (n ) multiplications. With Horner s method, p n (t) = x + t(x + t(... (x n + x n t)...)), which requires n multiplications. (t t )(t t 3 )... (t t n ) p n (t) = y (t t )(t t 3 )... (t t n ) + + y (t t )(t t )... (t t n ) n (t n t )(t n t )... (t n t n ) 3

for a given polynomial, y and the denominators are constants, so we have p n (t) = c (t t )(t t 3 )... (t t n ) + + c n (t t )(t t )... (t t n ) Each basis function requires n multiplications, so for n bais function the total is n total multiplications. 3. Without the Horner s method, p n (t) = c (t t )(t t 3 ) +... + c n (t t )(t t )... (t t n ), which is requires n(n )/ multiplications. With Horner s method, p n (t) = x + (t t )(x + (t t )(... (x n (t t n ))...)) which requires n multiplications. Problem 5 (0pts) Express the following polynomial in the correct form for evaluation by Horner s method:. p(t) = 5t 3 3t + 7t. p(t) = t 3. p(t) = 5t 3 3t + 7t p(t) = + t(7 + (t( 3 + 5t))). p(t) = t 3 p(t) = + t(t(t)) Problem 6 (5pts). For a given set of data points t,..., t n, define the function π(t) by Show that π(t) = (t t )(t t )...(t t n ). π (t j ) = (t j t )(t j t )...(t j t j )(t j t j+ )...(t j t n ).. Use the result of the previous part to show that the jth Lagrange basis function can be expressed as π(t) (t t j )π (t j ). 4

. Differentiating π(t) with respect to t π (t) = (t t ) (t t )...(t t n ) + (t t )(t t )...(t t n ) +... + (t t )(t t )...(t t j )... (t t n ) +... + (t t )(t t )...(t t j )... (t t n ) π (t) = (t t )...(t t j )... (t t n ) + (t t )...(t t j )... (t t n ) +... + (t t )(t t )...(t t j )(t t j+ )... (t t n ) +... + (t t )(t t )...(t t j )... (t t n ) When we evaluating at t j there will be only one term which will not contain (t t j ) π (t j ) = (t j t )(t j t )...(t j t j )(t j t j+ )...(t j t n ).. the j th Lagrangian basis is given by n k=,k j (t t k) n k=,k j (t t k) (t t )(t t )...(t t j )(t t j+ )...(t t n) (t j t )(t j t )...(t j t j )(t j t j+ )...(t j t n) multiplying numerator and denominator by (t t j ) we get (t t )(t t )...(t t j )(t t j )(t t j+ )...(t t n) (t t j )(t j t )(t j t )...(t j t j )(t j t j+ )...(t j t n) π(t). (t t j )π (t j ) Problem 7 (5pts) In general, is it possible to interpolate n data points by a piecewise quadratic polynomial, with knots at the given data points, such that the interpolant is. once continuously differentiable?. twice continuously differentiable? Computer Problem (0pts) Interpolating the data points t: 0 4 9 6 5 36 y: 0 3 4 5 6 ----------------------------------------------------- t: 49 64 y: 7 8 5

should given an approximation to the square root function.. Compute the polynomial of degree eight that interpolates these nine data points. Plot the resulting polynomial as well as the corresponding values given by the MATLAB function sqrt over the domain [0, 64].. Use a cubic spline routine (MATLAB function spline) to interpolate the same data and again plot the resulting curve along with the MATLAB function sqrt over the same domain as above. 3. Which of the two interpolants is more accurate over most of the domain? 4. Which of the two interpolants is more accurate between 0 and? For this problem, you need to implement a short piece of MATLAB code that does the polynomial interpolation (part ). You are allowed to use any method (basis) to compute the polynomial interpolation. For part, you are allowed to use the MATLAB functions spline and ppval. In case you do not know how to use the two MATLAB functions, use help to learn more about them and try a few simple examples first. An example of plotting sqrt function and a function f(t) on the domain [0, 64] is > t = 0:0.:64; > y_ = f(t); > y_ = sqrt(t); > plot(t, y_, -b, t, y_, -r ); 7.6. function cp07_06 % interpolation of square root function t = [0; ; 4; 9; 6; 5; 36; 49; 64]; y = [0:8]'; 3 p = polyfit(t,y,8); pp = spline(t,y); 4 ts = linspace(0,64,00)'; yr = sqrt(ts); yp = polyval(p,ts); ys =... 5 figure; hold on; plot(t,y,'ko',ts,yr,'k-',ts,yp,'b--',ts,ys,'r-.'); 6 title('computer Problem 7.6(a)-(c) -- Interpolants to Square Root'); 7 xlabel('t'); ylabel('y'); axis([0,64,0,8]); 8 legend('data points','square root','polynomial','spline',0); 9 ts = linspace(0,,00)'; yr = sqrt(ts); yp = polyval(p,ts); ys =... 0 figure; plot(t(:),y(:),'ko',ts,yr,'k-',ts,yp,'b--',ts,ys,'r-.'); title('computer Problem 7.6(d) -- Interpolants to Square Root'); xlabel('t'); ylabel('y'); axis([0,,0,]); 3 legend('data points','square root','polynomial','spline',0); 6

Computer Problem (0pts) The gamma function is defined by Γ(x) = 0 t x e t dt, x > 0. For an integer argument n, the gamma function has the value so interpolating the data points Γ(n) = (n )!, t: 3 4 5 y: 6 4 should yield an approximation to the gamma function over the given range.. Compute the polynomial of degree four that interpolates these five data points. Plot the resulting polynomial as well as the corresponding values given by the MATLAB function gamma over the domain [, 5].. Use a cubic spline routine to interpolate the same data and again plot the resulting curve along with the MATLAB function gamma over the domain [, 5]. 3. Which of the two interpolants is more accurate over most of the domain? 4. Which of the two interpolants is more accurate between and? 7.7. function cp07_06 % interpolation of gamma function t = [:5]'; y = [; ; ; 6; 4]; p = polyfit(t,y,8); pp = spline(t,y); 3 ts = linspace(0,5,00)'; yr = gamma(ts); yp = polyval(p,ts); ys =... 4 figure; hold on; plot(t,y,'ko',ts,yr,'k-',ts,yp,'b--',ts,ys,'r-.'); 5 title('computer Problem 7.7(a)-(c) -- Interpolants to Gamma... Function'); xlabel('t'); 6 ylabel('y'); legend('data points','gamma... function','polynomial','spline',); 7 ts = linspace(,,00)'; yr = gamma(ts); yp = polyval(p,ts); ys =... 8 figure; plot(t(:),y(:),'ko',ts,yr,'k-',ts,yp,'b--',ts,ys,'r-.'); 9 title('computer Problem 7.7(d) -- Interpolants to Gamma Function');... xlabel('t'); 0 ylabel('y'); legend('data points','gamma... function','polynomial','spline',4); 7