I have a little question about integration of an interpolating function. There is an error in assumptions of the integral.
I have a function that was obtained with an interpolation method:
try[1] = Interpolation[simmatrix[1], InterpolationOrder -> 3];
where 'simmatrix1' is a list of values. So I can plot the previos function with the following:
Plot[try[1][x], {x, 1.5, 2}]
and it is the output:
If I write
try[1]
I obtaine (I post a figure for a clear visualization):
Now let me define the following recursive funcions:
l[0] := try[1][x[0]]
l[h_] := Integrate[l[h - 1], {x[h - 1], 1.5, x[h]}]
So if I write
l[1]
I obtaine
but if I write
l[2]
I obtaine
with the error General::ivar
.
If now, for example, I need to evaluate the numerical integral over 'l2', in specific boundaries
NIntegrate[l[2], {x[1], 0, 0.1}, AccuracyGoal -> 5]
I obtaine the following errors (General::ivar
, NIntegrate::inumr
):
Is there a way to fix or solve the errors messages ? I tried with several assumptions but it didn't work. Thanks for any tips and helps!
x[i]
? $\endgroup$l[0] := try[1][x]; l[h_Integer?Positive] := Integrate[l[h - 1], x];
work for you? Note thatIntegrate[InterpolatingFunction[..][x], x]
in effect somputes $\int_{x_0}^x f(t)\,dt$, where $x_0$ is the beginning of the domain of the interpolating function. The variable staysx
in all cases instead ofx[0]
,x[1]
, etc. But that's what I'm asking, do the variables matter or can they all bex
? $\endgroup$