Skip to content
Snippets Groups Projects
Commit 63f79f05 authored by W. Spencer Smith's avatar W. Spencer Smith
Browse files

Clarification of A2 example that edge effects are not a problem for scipy

parent dea0f572
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,8 @@ c2 = CurveT(X, Y, 2)
print(c2.eval(6.5))
PlotCurve(c2, 5)
#PlotCurve(c2, 50) will look strange because of edge effects
#PlotCurve(c, 50) will look strange because of edge effects
#although scipy interp1d is "smart" enough to sort this out
Load('glass.csv')
......
  • Maintainer

    It must be smart enough to throw out duplicate x points as well, right? Otherwise a quadratic interpolation would be undefined around those points.

  • Author Owner

    I doubt that duplicate x points are thrown out by interp1d. It probably just ends up with a degenerate formula that becomes linear. If we had more time we could look into the details of interp1d, but for our purposes, we can just assume that the developers knew what they were doing. :smile:

  • Author Owner

    I actually just compared the scipy and the "lambda" versions of CurveADT again and they actually both have the same problems with quadratic interpolation at the edges. If the point being interpolated is too close to the edge, then the x_{i-1} point will be an index that wraps around to the end of the sequence. As long as eval(x) is far enough from the boundary, we don't have to worry about this. For plot you want to have a small enough number of intervals that none of the points are calculated too close to the boundary. The more data points in the original input, the less of an issue any of this is.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment