Question: a) Compute by hand the Lagrangian cardinal functions for the points x0 = -1, x = 0, x2 = 1, x3 = 2. b)

a) Compute by hand the Lagrangian cardinal functions for the points x0 = -1, x = 0, x2 = 1, x3 = 2. b) 

a) Compute by hand the Lagrangian cardinal functions for the points x0 = -1, x = 0, x2 = 1, x3 = 2. b) Consider the function f(x) = 2x-4-x and interpolate it by a polynomial of minimal degree by hand using the results above. c) Implement a Python algorithm that performs the same task above for arbitrary func- tions and arbitrary interpolation points. The algorithm only returns the value of the interpolated function in an array of points which is given as input. What is the maximal error e(x) = f(x) - p(x)| on the intervals [1, 2] and [5, 5]? Plot f(x) and p(x) in the same plot, on the interval [-1, 2]. d) The sequence of Chebyshev nodes on the reference interval [-1, 1] is 2k +1 Zk = COS [1,1], k = 0, . . ., n 1 2 n and can be transported on a general interval [a, b] by a+b b - a xk = + Zk. 2 2 Find the Chebyshev nodes on the interval [1, 2] for n = 3. e) Interpolate f(x) numerically in the Chebyshev nodes for n = 3. What is the maximal error on the intervals [1, 2] and [5,5]? Plot f(x) and the interpolating polynomial in the same plot, on the interval [1, 2]. f) Plot the error as a function in x, for both the interpolation in a) and the interpolation in c), on the interval [-1, 2]. Plot both errors in the same plot.

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