Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In polynomial _ interpolation. py you will find a function with definition def compute _ piecewise _ errors ( a , b , n _
In polynomialinterpolation. py you will find a function with definition
def computepiecewiseerrorsabnm M np Pf
The function should return as output:
uerrormatrix, nuerrormatrix two numpy.ndarrays, each of shape
nmnp
ufig, nufig two matplotlib.figure.Figures.
Complete the function to compute approximations to the error
for a range of polynomial degrees and
numbers of subintervals Row of uerrormatrix should
contain the errors when a uniform set of interpolating nodes is used in each
subinterval, while row of nuerrormatrix should contain the errors when the
nonuniform set of interpolating nodes is used in each subinterval.
Compute the approximation to the error by evaluating the error
for equally spaced points over and take the maximum of those.
The function should create two plots, one for the uniform errors and one for
the nonuniform errors. Each plot should be of the errors against have
a separate line for each and use plt The figures should be
returned in ufig and nufig.
Add a description at the top of your computepiecewiseerrors function
as a "docstring" that, when helppint.computepiecewiseerrors is run,
will briefly comment on and explain the results when and
with
a
b
You should also comment briefly in the "docstring" on the relative effectiveness
of increasing and at reducing the error.
Step 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