Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please code in Python, will leave a rating. Thank you. 3. The Runge Example. Let f(x) = 1 f 1 , 2 (-5,5). * All
Please code in Python, will leave a rating. Thank you.
3. The Runge Example. Let f(x) = 1 f 1 , 2 (-5,5). * All course materials (class lectures and discussions, handouts, homework assignments, examinations, web ma- terials) and the intellectual content of the course itself are protected by United States Federal Copyright Law, the California Civil Code. The UC Policy 102.23 expressly prohibits students and all other persons) from recording lectures or discussions and from distributing or selling lectures notes and all other course materials without the prior written permission of Prof. Hector D. Ceniceros. Using your Barycentric Formula code (Prob. 3) and (2) and (3) below, evaluate and plot the interpolating polynomial of f(x) corresponding to (a) the equidistributed nodes x = -5+ (10), j = 0,..., n for n = 4, 8, and 12. (b) the nodes x; = 5 cos(7), j = 0, ..., n for n= 4, 8, 12, and 100. (c) Repeat (a) for f(x) = e-r4/5 for x (-5,5] and comment on the result. Remark 1. It can be shown that for equidistributed nodes one can use the barycentric weights ter) = (-1): (?), j = 0,..., N, vil where () is the binomial coefficient (nchoosek(n,j) in Matlab). It can be shown that for the nodes x; = atb + banda cos(), j = 0,..., n, in [a, b], one can use 3 for j = 0 or j=n for j = 1, ..., n - 1. (3) 1) Make sure to employ (2) and (3) in your Barycentric Formula code for this problem. To plot the corresponding Pn(x) evaluate Pn(x) at a large number of points to have a good plotting resolution, e.g. Ek = -5+k(10e), k = 0,..., ne with ne = 5000. Note that your Barycentric Formula cannot be used to evaluate Pn(2) when x coincides with an interpolating node! Plot also f for comparison. Compare (a) and (6) and comment on the result in view of what you observed in Prob. 2. 3. The Runge Example. Let f(x) = 1 f 1 , 2 (-5,5). * All course materials (class lectures and discussions, handouts, homework assignments, examinations, web ma- terials) and the intellectual content of the course itself are protected by United States Federal Copyright Law, the California Civil Code. The UC Policy 102.23 expressly prohibits students and all other persons) from recording lectures or discussions and from distributing or selling lectures notes and all other course materials without the prior written permission of Prof. Hector D. Ceniceros. Using your Barycentric Formula code (Prob. 3) and (2) and (3) below, evaluate and plot the interpolating polynomial of f(x) corresponding to (a) the equidistributed nodes x = -5+ (10), j = 0,..., n for n = 4, 8, and 12. (b) the nodes x; = 5 cos(7), j = 0, ..., n for n= 4, 8, 12, and 100. (c) Repeat (a) for f(x) = e-r4/5 for x (-5,5] and comment on the result. Remark 1. It can be shown that for equidistributed nodes one can use the barycentric weights ter) = (-1): (?), j = 0,..., N, vil where () is the binomial coefficient (nchoosek(n,j) in Matlab). It can be shown that for the nodes x; = atb + banda cos(), j = 0,..., n, in [a, b], one can use 3 for j = 0 or j=n for j = 1, ..., n - 1. (3) 1) Make sure to employ (2) and (3) in your Barycentric Formula code for this problem. To plot the corresponding Pn(x) evaluate Pn(x) at a large number of points to have a good plotting resolution, e.g. Ek = -5+k(10e), k = 0,..., ne with ne = 5000. Note that your Barycentric Formula cannot be used to evaluate Pn(2) when x coincides with an interpolating node! Plot also f for comparison. Compare (a) and (6) and comment on the result in view of what you observed in Prob. 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started