The evaluation of the interpolation polynomial in Newton’s form can be then done
ID: 3858275 • Letter: T
Question
The evaluation of the interpolation polynomial in Newton’s form can be then done with the Horner-like scheme seen in class:
p = cn
for j = n 1, n 2, . . . , 0
p=cj +(xxj)p; end
(a) Write computer codes to compute the coefficients c0, c1, . . . , cn and to evaluate the corresponding interpolation polynomial at an arbitrary point x. Test your codes and turn in a run of your test.
(b) Consider the function f(x) = ex2 for x [1,1] and the nodes xj = 1+j(2/10), j = 0,1,...,10. Use your code(s) in (a) to evaluate P10(x) at the points x j = 1 + j(2/100), j = 0, 1, . . . , 100 and plot the error f(x) P10(x).
Explanation / Answer
-----------------------------------------------------------------------------------------------
output:
-----------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
(b)
Answer:---->
Use your code(s) in (a) to evaluate P10(x) at the points x j = 1 + j(2/100), j = 0, 1, . . . , 100 and plot the error f(x) P10(x).
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.