Question: Develop a script that generates and evaluates a polynomial p ( x ) of order n - 1 in barycentric form, p ( x )

Develop a script that generates and evaluates a polynomial p(x) of order n-1 in
barycentric form,
p(x)=k=1nwkfkx-xkk=1nwkx-xk,
interpolating a given set of function values f(xk)=fk=p(xk) at a set of n interpo-
lation nodes x1,dots,xn with barycentric weights wk=(prodj=1,jkn(xk-xj))-1. The
interpolating polynomial p is then evaluted at m locations, l,l=1,dots,m.
Write a MATLAB function that fills out the following template:
functioa pvals = baryInterp(xnodes, fvala, )
%% Barycentric polymonial interpolation
7 Generate and evaluate a polynonial, p(x), that interpolates
valuen in fvals at xnodes: xnodes (i) vals(i)1=1,dots,n
x vhere z= length(fvalu). To polynomial p is evaluated at the
%x-locations liated in .p(x) bas order n=1.
% The barycestric form of the polynonial interpolant is used.
X Inputs: xnodes - interpolation points
% fvals - function values to be interpolated at moden
z ,x1-x-10cations at vhich to evaleate the interpolast.
X Output: prals - interpolating polynoaial evaluations at xi:
%
pvals(i)=p((1)),1=1,dots,n where = length ()
n= length(fvals); m=length (xi) ;
Refer to Gautsch, Section 2.2.5 and the algotithm fragment (2.108) on p.93. Also see Tre-
fetbot, Chapter 5. Extra style points will be awarded foe using a single one dimensional array
of length n for {wk},(instead of the two dimensionsl arrays descibed in Cautschi asd Tre-
fethen) and rescaling {wk} during the recunsion that generates it to avoid overflow/underflow.
 Develop a script that generates and evaluates a polynomial p(x) of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!