Closed hesampour closed 5 years ago
I believe that needs to be done with nested one-dimensional integrals.
@MasonProtter would you please explain more?
Suppose I want to compute the integral:
I can't express this as a simple integral over some square domain (unless there is some clever change or basis allowed by F
). Instead, one has to treat it as two nested integrals, ie:
hquadrature(u -> hquadrature(v -> F(u, v), u, t), 0, t)
Don’t use nested 1d adaptive integrals. That is almost always suboptimal because the inner adaptation doesn’t know about the outer integral.
You can use HCubature via a change of variables. In your example above, just change variables in the inner integral from u to u=z*(t-v)+v
where z goes from 0 to 1, with a Jacobian factor of t-v
multiplying the integrand.
how we can compute a non rectangular integral (which some boundaries of the integral is a variable not a static value) with this package: something like this: