Math 105A Homework Assignment 2 Hints: Interpolation Errors and Hermite Polynomials, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Hints for homework assignment 2 in math 105a during the summer session i 2003-04. It covers topics related to interpolation errors, including upper bounds for the error in first-degree interpolating polynomials and the use of newton forward-difference and backward-difference formulas. Additionally, it discusses hermite polynomials and the process of computing their error bounds and coefficients. The document also mentions the use of matlab for solving certain parts of the problem.

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-4iv
koofers-user-4iv 🇺🇸

5

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Jim Lambers
Math 105A
Summer Session I 2003-04
Homework Assignment 2 Hints
Each homework assignment from the textbook will be accompanied by a handout like this one,
that contains hints about the exercises. As I receive questions on the assignment, this handout may
be updated with additional information. When this occurs, this will be indicated on the Updates
page of the site,
http://math.uci.edu/jlambers/math105a/updates.html
which you should be checking frequently.
Section 3.1
15. Recall that the error in the interpolating polynomial is very similar in appearance to the
Taylor remainder, except that there are n+ 1 distinct centers, where nis the degree of the
interpolating polynomial. Therefore, computing an upper bound for the interpolation error on
a given interval is similar to computing an upper bound for the error in a Taylor polynomial
on an interval, except that there is more work involved in computing an upper bound for
|(xx0)(xx1)· · · (xxn)|, where x0, x1, . . . , xnare the interpolation points. You need to
compute the maximum and minimum values using calculus, and use the value that is largest
in magnitude for the bound of this part of the error.
17. There is a typo in the answer in the back of the book. The reasonable choice of a step size is
0.004, not 0.04.
To ensure that linear interpolation is sufficiently accurate on each subinterval, answer this
question: assume you are given two points xand x+h, where his the step size and both x
and x+hare in the interval [1,10]. What is an upper bound for the error in the first-degree
interpolating polynomial for f(x) = log10 xon [x, x +h], in terms of h?
21. On Friday, July 16, I will be posting the MATLAB code that was discussed in lab on Wednes-
day, July 14. This code illustrates the usage of the polyfit and polyval functions.
When working with vectors, you must use a .with the *,/and operators so that MATLAB
knows to apply these operations to each component of the vector. For example, given two
vectors xand yof the same length, x.*y is a vector whose components are the products
of x(i) and y(i), for i= 1,2, . . . , n, where n = length(x). Also, 1./x is a vector whose
components are the reciprocals of the components of x.
Unlike the sample code, this problem does not require any graphing. There will actually be
very little code needed.
1
pf3

Partial preview of the text

Download Math 105A Homework Assignment 2 Hints: Interpolation Errors and Hermite Polynomials and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Jim Lambers Math 105A Summer Session I 2003- Homework Assignment 2 Hints

Each homework assignment from the textbook will be accompanied by a handout like this one, that contains hints about the exercises. As I receive questions on the assignment, this handout may be updated with additional information. When this occurs, this will be indicated on the Updates page of the site,

http://math.uci.edu/∼jlambers/math105a/updates.html

which you should be checking frequently.

Section 3.

  1. Recall that the error in the interpolating polynomial is very similar in appearance to the Taylor remainder, except that there are n + 1 distinct centers, where n is the degree of the interpolating polynomial. Therefore, computing an upper bound for the interpolation error on a given interval is similar to computing an upper bound for the error in a Taylor polynomial on an interval, except that there is more work involved in computing an upper bound for |(x − x 0 )(x − x 1 ) · · · (x − xn)|, where x 0 , x 1 ,... , xn are the interpolation points. You need to compute the maximum and minimum values using calculus, and use the value that is largest in magnitude for the bound of this part of the error.
  2. There is a typo in the answer in the back of the book. The reasonable choice of a step size is 0.004, not 0.04. To ensure that linear interpolation is sufficiently accurate on each subinterval, answer this question: assume you are given two points x and x + h, where h is the step size and both x and x + h are in the interval [1, 10]. What is an upper bound for the error in the first-degree interpolating polynomial for f (x) = log 10 x on [x, x + h], in terms of h?
  3. On Friday, July 16, I will be posting the MATLAB code that was discussed in lab on Wednes- day, July 14. This code illustrates the usage of the polyfit and polyval functions. When working with vectors, you must use a. with the , / and ∧ operators so that MATLAB knows to apply these operations to each component of the vector. For example, given two vectors x and y of the same length, x.y is a vector whose components are the products of x(i) and y(i), for i = 1, 2 ,... , n, where n = length(x). Also, 1./x is a vector whose components are the reciprocals of the components of x. Unlike the sample code, this problem does not require any graphing. There will actually be very little code needed.

Section 3.

  1. As mentioned on the Errata page of the site, the algorithm described in the Lecture 9 Notes that computes divided differences has been updated so that the inner loop counts from n down to i, instead of the other way around.
  2. (a) Be sure to follow the directions. You must use the Newton forward-difference formula, rather than computing divided differences. The answer is the same, but the forward- difference formula takes advantage of the fact that the points are equally spaced in order to eliminate the need to compute divided differences. (b) A similar comment applies to this part. You must use the Newton backward-difference formula.
  3. (a) (b) This is not as interesting a question as it looks.
  4. Substitute x 2 into the given formula for Pn(x) and solve for a 2. You will need to use the recursive definition of the divided differences. You might find it helpful to resort to a little algebraic trickery. If you are able to obtain the expression given in the back of the book, you can add and subtract f [x 1 ] in the numerator of the first fraction. This will allow you to simplify the expression as required. Alternatively, you can keep in mind that the definition of the divided difference f [x 0 , x 1 ,... , xn] does not depend on the points x 0 , x 1 ,... , xn being listed in order.

Section 3.

  1. (a) (b) Computing the error bound for a Hermite polynomial is essentially the same as comput- ing the error bound for a Lagrange or Newton interpolating polynomial. In the Hermite case, each interpolation point is used twice as a center in the Newton form of the poly- nomial, so the error term contains a factor of the form

∏n i=0(x^ −^ zi)

(^2) , where z 0 , z 1 ,... , zn are the distinct interpolation points. Furthermore, instead of using the (n + 1)st deriva- tive and (n + 1)!, you are using the (2n + 2)nd derivative and (2n + 2)!, again, because each distinct interpolation point is used twice. Since the error bound only applies on the interval [z 0 , zn], you only need to consider the interval [0. 30 , 0 .35] in determining the error bound. (c) When adding the data, if you are using divided differences, you can save yourself some work by keeping in mind that the divided difference f [x 0 , x 1 ,... , xn] does not depend on the points x 0 , x 1 ,... , xn being listed in order. You should not need to recompute any of the divided differences from part (a); you will only be adding new ones.