Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Suppose f(x} = X° — 25 XO Ns ee ahs Newton 3

Suppose f(x} = X° — 25 XO Ns ee ahs Newton 3

Math

Suppose f(x} = X° — 25 XO Ns ee ahs Newton
3. Write down a divided-difference table and the Newton form of the
interpolating polynomial for the following set of data.
_
x i/1 42 0 2
fey [2 6 0 14
TAM |e
Show how this polynomial can be evaluated at a given point x by using
four steps of a Horner’s rule-like method.
7 . 8-4 f doce 12 en the Runge function

: . 00,

*. Use MATLAB to fit various piecewsse polynomials ro the Runge fue
using the same nodes as in part (a) of exercise 4. 1s
(a) Find the piecewise linear interpolant of f(x). (You msy oe s

routine interp1 or write your own routine. Type belp '
MATLAB to find out how to use iaterpi.)

, NO Cao”
oe | <ad the piecewise cubic Hermite interpolant of f(x). (Write your own

ibs Fine "for this, using formulas (8.17) and (8.18).
end 4 cubic spline interpolant of f(x). (You may use either the

(c) erp! command or the spline command in MATLAB.)

1
-h case above, plot f(x) and the interpolant on the same graph. If

In ash you can put all of your graphs on the same page by using the

‘ou x

gubpiot command. | |

: mputer libraries often use tables of function values together with

8. AS eewise linear interpolation to evaluate elementary functions such as
rT x, because table lookup and interpolation can be faster than, say, using

4 Taylor series expansion.

(a) In MATLAB, create a vector x of 1000 uniformly-spaced values
between 0 and z. Then create a vector y with the values of the sine
function at each of these points.

(b) Next create a vector r of 100 randomly distributed values be-
ween 0 and xz. (This can be done in MATLAB by typing
r = pixrand(100,1);.) Estimate sin r as follows: For each value
r(j), find the two consecutive x entries, x(i) and x(i+1) that satisfy
x(i) <r(j) < x(it+1). Having identified the subinterval that contains
r(j), use linear interpolation to estimate sin (r(j)). Compare your
results with those returned by MATLAB when you type sin(r). Find
the maximum absolute error and the maximum relative error in your
results.

9. Determine the piecewise polynomial function
_ f Pix) ifO0<x <1,
P(x) = {rata ifl<x <2,
that is defined by the conditions
¢ Pi(x) is linear.
¢ P2(x) is quadratic.
* P(x) and P’(x) are continuous at x = 1.
* P(0)=1, P(1) = —1, and P(2) = 0.
49 rot this function.
“Aaa a given function satisfying f(0) = 1, f(1) = 2, and f(2) = 0.
| intern rat spline interpolant r(x) is defined as a piecewise quadratic that
detivatinn f at the nodes (xp = 0, x; = 1, and x. = 2) and whose first
| imerpole is continuous throughout the interval. Find the quadratic spline
subinteryal : f that also satisfies r’(0) = 0. (Hint: Start from the left
| 1. ;
Let Fx) — .2,_ air, -~ i>, —~ -* cll . 4 . . 1° wy .

12. Show chat the following function is a natural cubic spline through the
points (0, 1), (1. 1), (2, 0), and (3, 10):
l+x-x if€Osx<1,
s(x) = 01 —2(x— 1) — 3x — TP + le - 13 ifl<x<2,
A(x — 2) + Ax — 27 — 3(x—2P if2<x<3,
13. Determine all the values of a, b, c, d, ¢, and f for which the following
function is a cubic spline:
axct+b(x-1)) if x € (—00.1],
s(x) = ¢ cx? +d if x € [1,2],
ext + f(x—2) — if x € [2, 00).

14. Use MATLAB’s spline function to find the not-a-knot cubic spline
interpolant of f(x) = e-?* sin(107x), using #2 = 20 subintervals of equal
size between x) = 0 and x); = 1. (To learn how to use the spline routine
type help spline in MATLAB.) Plot the function along with its cubic
spline interpolant, marking the knots on the curves.

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE