Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Python please! Recall that Lagrange interpolating polynomial for a set of N points, (nf),-1....,N, is given by p)-p!N-(e), where p!N-)- (N-1) x), where P

In Python please! image text in transcribed

Recall that Lagrange interpolating polynomial for a set of N points, (nf),-1....,N, is given by p)-p!N-(e), where p!N-)- (N-1) x), where P k+n Write a code that implements polynomial interpolation and run the tests described below. Different Orders. Letf(x) - arctan(x). Construct polynomial approximations to f(x) forxe[-10,10] Use N 2,4,8,16,32: distribute your N sample points in [-10,10] uniformly, ie, setting (for every N) x,--10+20(n-1)/(N-1), fn=f(xn): n=1, . . . , N. Plot the graphs of the original function and the approximations that you constructed in the same graph for x e [-11,11]. Discuss your observations. Different Point Locations. Consider the same function f(x) = arctan (x). Suppose we just want to use a fifth order polynomial (i.e., N = 6). Is there a way to place the sample points xn, n = 1, , 6 in some optimal way? Try a few possibilities (one of them is the uniform sampling as described above); look at the errors in max-norm, i.e., maxlf(x)-f(x)I, xeI-10,10] , where f(x) is the polynomial approximation that you constructed. Estimate the max-norm error numerically by sampling the value of lf(x) - f(x)| at a sufficiently fine resolution (mesh size about 0.1 should suffice). Plot the graphs of your approximations. Discuss your findings. Recall that Lagrange interpolating polynomial for a set of N points, (nf),-1....,N, is given by p)-p!N-(e), where p!N-)- (N-1) x), where P k+n Write a code that implements polynomial interpolation and run the tests described below. Different Orders. Letf(x) - arctan(x). Construct polynomial approximations to f(x) forxe[-10,10] Use N 2,4,8,16,32: distribute your N sample points in [-10,10] uniformly, ie, setting (for every N) x,--10+20(n-1)/(N-1), fn=f(xn): n=1, . . . , N. Plot the graphs of the original function and the approximations that you constructed in the same graph for x e [-11,11]. Discuss your observations. Different Point Locations. Consider the same function f(x) = arctan (x). Suppose we just want to use a fifth order polynomial (i.e., N = 6). Is there a way to place the sample points xn, n = 1, , 6 in some optimal way? Try a few possibilities (one of them is the uniform sampling as described above); look at the errors in max-norm, i.e., maxlf(x)-f(x)I, xeI-10,10] , where f(x) is the polynomial approximation that you constructed. Estimate the max-norm error numerically by sampling the value of lf(x) - f(x)| at a sufficiently fine resolution (mesh size about 0.1 should suffice). Plot the graphs of your approximations. Discuss your findings

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_2

Step: 3

blur-text-image_3

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

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

More Books

Students also viewed these Databases questions