Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Repeat Worksheet 6 Q1 for the barycentric formula, T1 TL wi yi where we have defined the barycentric weights While mathematically equivalent to the

image text in transcribed

1. Repeat Worksheet 6 Q1 for the barycentric formula, T1 TL wi yi where we have defined the "barycentric weights" While mathematically equivalent to the Lagrange interpolation formula, the barycentric formula has the prac- tical advantage that the bulk of the computation _computing the barycentric weights can be performed "offline" and is efficiently updatable to include more interpolation points. (a) Implement this as a Matlab function with the signature function y-linterp_bary(X, Y, x) (X and Y are arrays containing ro, , Tn and yo, , yn, resp.) You may not use any of Matlab's polynomial routines (like polyfit or interp1) nor the Symbolic Math Toolbox. Test your code by 1. picking your favorite polynomial p of degree five, 2. populating X with six distinct numbers, 3. setting Y to be p evaluated at the corresponding entries of X, using polyval, 4. picking x to be a number besides those in X, 5. com paring p(x) with Interp-bary(X, Y, x). For example, implement x- 2,5-1 by p- 0(x) polyval([1 0 0 0 0-1], x); (b) Extend your code to allow x to be an array, so that y is an array of the same dimensions, each entry being the Lagrange intcrpolation formula cvaluated at thc corrcsponding cntry of x. Rcusing from Part (a) thc polynomial function p and the arrays X and Y, run the following commands xlinspace (min(X)-1, max (X)+1, 100); plot(x, p(x), 'ko: ', x, linterp_bary(X, Y, x), 'rx: '); The red s should coincide with the black os

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Oracle Solaris 11 System Administration

Authors: Bill Calkins

1st Edition

0133007170, 9780133007176

More Books

Students also viewed these Databases questions

Question

4-1. What is meant by the term you attitude? [LO-1]

Answered: 1 week ago