required submission 1 page pdf document and scripts codes uploaded to

Question

Required submission: 1 page PDF document and scripts/codes uploaded to Canvas.
The purpose of this assignment is to examine how the locations of the nodes zo,1,..., affect
the accuracy and robustness of polynomial interpolation. To compute the interpolating polynomial,
you will be using the barycentric form described in lectures. For this, you need to download the
matlab functions baryweights.m and baryinlerp.m from the computing assignment page in Canvas.
The first computes the weights o, ,, of the barycentric form and the second computes the
interpolating polynomial.
To begin, consider the equally-spaced nodes on [-1, 1], given by
Write code to compute the error of the interpolating polynomial
-max IP(z)-(z)l.
for some suitable range of n (in practice, you should replace this maximum by the maximum on
some sufficiently fine grid) and plot log(s) versus n for the test functions:
J1 (²) = 5=4²² √2(z)=1+162²"
5-4z
Using this, comment on the accuracy of polynomial interpolation at equally spaced nodes.
Next, consider the so-called Chebysher nodes on [−1, 1], given by
Z₁ =con(ix/n), i=0, ..., n.
(2)
Repeat the previous experiment with these nodes instead of (1) and test it on the functions above.
Note that in this case you should not use the function baryweights.m to find the weights, but instead
use the known formula
w=½, ™;=(-1)³, j = 1,...,1-1, x=(-1)",
(1)
1
(if you don't do this, your computation may result in under/overflow). Is polynomial interpolation
at Chebyshev nodes accurate? Is it robust?
Finally, use the Chebyshev nodes to approximate the function
Js(z) = n(10¹2).
Find the smallest value of n (to within ±10) such that e₂ < 10-5.