



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Assignment; Professor: Lambers; Class: Numerical Analysis I; Subject: Mathematics; University: University of Southern Mississippi; Term: Fall 2009;
Typology: Assignments
Limited-time offer
Uploaded on 02/25/2010
4
(1)10 documents
1 / 7
This page cannot be seen from the preview
Don't miss anything!
On special offer
Jim Lambers MAT 460/ Fall Semester 2009- Homework Assignment 9 Solution
0.30 0.29552 โ 0. 14200 0.95250 โ 1. 0500 0.32 0.31457 โ 0. 16300 20. 0.94924 โ 0. 0134 โ 431. 41 0.32 0.31457 โ 0. 16367 โ 0. 83866 0.94433 โ 0. 055333 0.35 0.34290 โ 0. 16533
0.35 0. It follows that the Hermite interpolating polynomial is
ํป 5 (ํฅ) = 0 .29552 + 0.95534(ํฅ โ 0 .30) โ 0 .142(ํฅ โ 0 .30)^2 โ 1 .05(ํฅ โ 0 .30)^2 (ํฅ โ 0 .32) + 20 .732(ํฅ โ 0 .30)^2 (ํฅ โ 0 .32)^2 โ 431 .41(ํฅ โ 0 .30)^2 (ํฅ โ 0 .32)^2 (ํฅ โ 0 .35)
Evaluating this polynomial at ํฅ = 0 .34 using five-digit rounding arithmetic yields ํป 5 (0.34) = 0. 33349. (b) Determine an error bound for the approximation in part (a), and compare it to the actual error.
Solution The exact value, to 14 digits, is sin 0.34 = 0.33348709214081, so the actual er- ror is โฃ 0. 33348709214081 โ 0. 33349 โฃ = 2. 91 ร 10 โ^6. The bound for the error on [0. 30 , 0 .35] is given by
โฃํ (ํฅ) โ ํป 5 (ํฅ)โฃ =
โฃโฃ^ โ^ sin^ ํ 720
where ํ โ [0. 30 , 0 .35]. Evaluating this error term at ํฅ = 0.34 yields
โฃ sin 0. 34 โ ํป 5 (0.34)โฃ =
โ sin ํ 720
โ sin 0. 35 720
This bound is not inconsistent with the actual error, because the approximation was computed using five-digit rounding arithmetic.
(c) Add sin 0.33 = 0.32404 and cos 0.33 = 0.94604 to the data, and redo the calculations. Solution Proceeding as in part (a), we construct the divided-difference table with the new data included. This yields
Time 0 3 5 8 13 Distance 0 225 383 623 993 Speed 75 77 80 74 72
(a) Use a Hermite polynomial to predict the position of the car and its speed when ํก = 10 s. Solution The following MATLAB function, which is a modification from the function hw2prob321 presented earlier, computes the coefficients of the Newton form of the Her- mite polynomial. % this function computes the Hermite interpolating polynomial % for a given function f(x) using Newtonโs interpolatory % divided-difference formula. The x vector contains the % interpolation points, the y vector contains the corresponding % values of f(x), and the yp vector contains the corresponding % values of fโ(x). At the end of the computation, the vector d % contains the coefficients of the Newton form of the Hermite % polynomial. function d=hw2prob337(x,y,yp)
% n is the degree of the interpolating polynomial n=2*length(y)-1;
% initialize divided-difference table: d=zeros(1,n+1);
% xx stores the x-values, with each value listed twice xx=zeros(n+1,1); xx(1:2:n)=x; xx(2:2:n+1)=x;
% d contains the current divided differences
% initially, contains each y-value twice d(1:2:n)=y; d(2:2:n+1)=y;
for i=1:n, % compute divided differences, overwriting those % we donโt need for j=n+1:-1:i+1, if xx(j)==xx(j-i), % use derivative value d(j)=yp(j/2); else d(j)=(d(j)-d(j-1))/(xx(j)-xx(j-i)); end end end Using this function, we obtain the coefficients Hermite interpolating polynomial for the given data,
ํป 9 (ํฅ) = 75 ํฅ + 0. 222222 ํฅ^2 (ํฅ โ 3) โ 0. 0311111 ํฅ^2 (ํฅ โ 3)^2 โ
Applying the nested multiplication algorithm from the Lecture 9 Notes to this polyno- mial, we obtain the coefficients of the Newton form of a polynomial ํ(ํฅ) such that
ํป 9 (ํฅ) = 742.5 + (ํฅ โ 10)ํ(ํฅ),
which implies that ํป 9 (10) = 742.5. Furthermore, ํป 9 โฒ(10) = ํ(10), so by applying nested multiplication to ํ(ํฅ), we can compute ํป 9 โฒ(10) = ํ(10) = 48.38 ft/s.
(b) Use the derivative of the Hermite polynomial to determine whether the car ever exceeds a 55 mi/h speed limit on the road. If so, what is the first time the car exceeds this speed? Solution Using the MATLAB function powerform provided on the Code page of the site, we can convert the Newton form of ํป 9 (ํฅ) from part (a) into the power form, and use MATLABโs polyder function to obtain the coefficients of ํป 9 โฒ(ํฅ). Noting that 55 mi/h is equivalent to approximately 80.ยฏ6 ft/s, we can apply MATLABโs roots function
Since the Hermite polynomial ํป 3 (ํฅ) is unique, and ํป(ํฅ) satisfies the requirements of ํป 3 (ํฅ), we must have ํป 3 (ํฅ) = ํป(ํฅ).