Message Boards Message Boards

0
|
2252 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Multiple nested (time ordered) integrals with NIntegrate

Posted 3 years ago

I want to construct and calculate multiple (time - ordered) nested integrals of two functions: enter image description here

the "fo" function is applied to the odd and even "fe" to the even times. I have many terms and different numbers of integrals. The code that I have is:

feven[n_] := Times @@ fe /@ Array[t[2 #] &, {n}]
fodd[n_] := Times @@ fg /@ Array[t[2 # - 1] &, {n}]

fint[n_, y_] := 
 Inactive@Integrate[feven[n] fodd[n], ##] & @@ 
  Prepend[Table[{t[k], 0, t[k - 1]}, {k, 2, 2 n, 1}], {t[1], 
    0,y}]

So for fint[3,t] I indeed get the correct integrals and the correct order. The problem is that my fo and fe functions are complicated to be calculated analytically, so I want to use NIntegrate for each step. So I do the following (using ?NumericQ doesn't change anything)

fint[n_, y_] := 
NIntegrate[feveng[n] foddg[n], ##] & @@ 
 Append[Table[{t[k], 0, t[k - 1]}, {k, 2 n, 2, -1}], {t[1], 
   0, y}]

I use a simple function to test it so I set fe[n]:=x, fg[n]:=x and I get

NIntegrate[
 feveng[2] foddg[2], {t[4], 0, t[3]}, {t[3], 0, t[2]}, {t[2], 0, 
  t[1]}, {t[1], 0, 1}]

along with the error

NIntegrate::nlim: t[4] = t[3] is not a valid limit of integration.

I think the problem might be with NIntegrate, that it is not supposed to calculate these kinds of integrals like Integrate does. Because for Integrate I get a correct result for my simple test functions.

Do you have any idea on how I can make this work?

Thank you!

POSTED BY: Eva Mpis
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract