I need to integrate along a parametric space curve defined by some data points. Here is a simple example that works in Version 10.
circle = Table[{Cos[ \[Pi] t ], Sin[ \[Pi] t ]}, {t, 0, 1, .1}];
interp[u_] := {
ListInterpolation[circle[[All, 1]], {{0, 1}}][u],
ListInterpolation[circle[[All, 2]], {{0, 1}}][u]};
Show[Graphics[Point[circle]], ParametricPlot[interp[x], {x, 0, 1}]]
NIntegrate[
interp[x], {x, 0, 1}] (* returns {0,1/Pi} as expected *)
However, if I repeat this example with BSplineFunction providing the interpolation, the integration fails, because it thinks BSplineFunction is not numeric.
circle = Table[{Cos[\[Pi] t ], Sin[\[Pi] t ]}, {t, 0, 1, .1}];
Show[Graphics[Point[circle]],
ParametricPlot[BSplineFunction[circle][t], {t, 0, 1}]]
NIntegrate[
BSplineFunction[circle][t], {t, 0,
1}] (* fails with NIntegrate::inum *)
I have tried my usual bag of tricks on this without any luck. Any hints on getting integration to work along a BSpline would be appreciated.