Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.2K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

Numerical Integration of interpolated function returning a list

Posted 1 year ago

I am encoutering a problem when trying to perform the numerical integration of a function I have obtained from interpolation that returns a list. The problem is just with NIntegrate, because Plot works well.

dataX = Table[{n, {n, 2 n}}, {n, 0, 10}];

dataF = Interpolation[dataX, InterpolationOrder -> 1];

dataFi[x_?NumericQ, i_] := dataF[x][[i]];

Plot[dataF[x], {x, 0, 10}]

NIntegrate[dataF[x], {x, 0, 10}] (*Returns NIntegrate::inum*)

NIntegrate[Table[dataFi[x, i], {i, 1, 2}], {x, 0, 10}] (*Returns result with several Part::partw warnings*)

Table[NIntegrate[dataFi[x, i], {x, 0, 10}], {i, 1, 2}] (*Returns result and one Part::partw warning*)

I think I have done this in the past with previous versions and it was working, now with 13.3 it does not. Is it a bug or is this intended? Possible workarounds?

POSTED BY: Giorgio Busoni
2 Replies
POSTED BY: Gianluca Gorni
POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard