Question: (a) Implement the Barycentric Formula for evaluating the interpolating polynomial for arbitrarily distributed nodes x0,...,xn; you need to write a python function or script that
(a) Implement the Barycentric Formula for evaluating the interpolating polynomial for arbitrarily distributed nodes x0,...,xn; you need to write a python function or script that computes the barycentric weights (n) = 1/ (xj xk ) first and another code to j k=j use these values in the Barycentric Formula. Make sure to test your implementation. (b) Consider the following table of data xj f(xj) 0.00 0.0000 0.25 0.7071 0.50 1.0000 0.75 0.7071 1.25 -0.7071 1.50 -1.0000 Use your code in (a) to find P5(2) as an approximation of f(2).
We proved in class that where Pn is the interpolating polynomial of f at the nodes xo, , xn, P* is the best approximation of f, in the maximum (infinity) norm, by a polynomial of degree at most n, and An is the Lebesgue constant, i.e. An- |L"|0, where (a) Write a computer code to evaluate the Lebesgue function (2) associated to a given set of pairwise distinct nodes zo, .. . , Tn. (b) Consider the equidistributed points x,-1+j(2) for j - 0,... ,n. Write a com puter code that uses (a) to evaluate and plot Ln(x) (evaluate Ln(x) at a large number of points-k to have a good plotting resolution, c.g. xk =-1+ k(2e), k = 0, . . . , ne
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
