1
$\begingroup$

I was trying to give the interpolation of a function $f(x)=1/(1+25x^2)$, then I met the problem below:

As I want to see the behavior as the interpolation order became bigger, I set it progressed. And it ran properly, like this: picture

In this picture, I used ListLinePlot[expr, InterpolationOrder -> n] function to set the order.

And then, I used the Interpolation function directly, but it behaved like this:

picture2

We can see it carefully that merely all the points are on the interpolation line.

But why the two interpolation give gradually the different answers as the order became bigger? As there were only $20$ points, $n$ bigger than $20$ is not permitted.

I've tried all the methods in the function Interpolation (well, there are all only two), and it gave me the same image. Can anyone explain the phenomena?

pnt = Table[{x, 1/(1 + 25 x^2)}, {x, -1, 1, .1}];
Table[a1 = Interpolation[pnt, InterpolationOrder -> n]; 
 Show[Plot[a1[x], {x, -1, 1}, PlotRange -> All], ListPlot[pnt]], {n, 
  0, 20, 5}]
ListLinePlot[pnt, InterpolationOrder -> #, PlotRange -> All, 
   PlotMarkers -> Automatic] & /@ Range[0, 20, 5]
$\endgroup$
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.