Question: Q2 (MATLAB) (a) Write a code for polynomial interpolation in the Lagrange basis by H&f(IN) the barycentric formula pn(x) = n fak k-0 2-Ik

Q2 (MATLAB) (a) Write a code for polynomial interpolation in the Lagrange basis by H&f(IN) the barycentric

Q2 (MATLAB) (a) Write a code for polynomial interpolation in the Lagrange basis by H&f(IN) the barycentric formula pn(x) = n fak k-0 2-Ik sin distinct points {k}_o. Let f(x)=e-5 sin sin k-02-2k mula is pn(x) = 1 II-0,14k (*k - x) on [0.16, 0.317]. Construct 11, where #k 21, and 31 (n = 10, 20, 30) Chebyshev interpolation points on this interval. Evaluate and compare pio(x), P20(x), P30(x), and f(x) at x = 0.2, 0.25, and 0.3. 12-10 + (-1) (b) Simplify the code in part (a) for Chebyshev points, for which the barycentric for- 1 f(zo) + ' -1 (-1)*f(x) + 1 (-1)"(2) 22-10 k=1 I-In (equivalently, letting #40 = 1, I-Ik n-1 2k=1 I-Ik + k = (-1)^, and n = (-1)" in the barycentric formula in part (a)). Repeat the ex- periment in part (a). Make sure that you get the same result as in part (a). for any 1(-1)" 22-2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

MATLAB code for polynomial interpolation in the Lagrange basis by the barycentric formula Here is the code Define the function fx f x exp5xsinxsinsinx ... View full answer

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 Programming Questions!