If I construct a vector-valued InterpolatingFunction, say with
f = Interpolation[{{0, {1,1}}, {1, {0,0}}, {2, {0,1}}, {3, {1,0}}}]
plotting the result works just fine. For example,
ParametricPlot[f[t], {t, 0, 3}]
draws a letter "alpha" in the plane. And, as Feyre pointed out, calling Integrate also works fine, with
Integrate[f[t], {t, 0, 3}]
returning {3/4, 3/2}
. But Integrate can't deal with more complicated situations, returning unevaluated for even such simple variants as
Integrate[2 f[t], {t, 0, 3}]
More complicated cases can be handled numerically with NIntegrate, as long as the thing being integrated is a scalar. For example,
NIntegrate[f[t].f[t], {t, 0, 3}]
returns 1.78214
. But if I try to NIntegrate a vector-valued InterpolatingFunction, even just:
NIntegrate[f[t], {t, 0, 3}]
version 10.0.2 of Mathematica gives me the error message:
NIntegrate::inum: Integrand
InterpolatingFunction[{{0,3}},{5,3,0,{4},{4},0,0,0,0,Automatic,
{},{},False},{{0,1,2,3}},
{{{0,0}},{{1,1}},{{1,0}},{{0,1}}},{Automatic}][t]
is not numerical at {t} = {0.00795732}. >>
In a case too complicated for Integrate, is there some way that I can convince NIntegrate to work, component by component, over such a vector?
Table[]
andTotal[]
$\endgroup$