Can I use multiple methods for a numerical integration?
If you mean different integration rules, then with NIntegrate you can use Method with Cartesian rule specification:
Clear[f];
f[x_, y_, w_, z_] := x + y + w + z;
NIntegrate[
f[x, y, w, z],
{x, 0, 2Pi},
{y, 2, 10},
{w, Pi/2, 32Pi},
{z, 0, 1},
Method ->
{{"GaussKronrodRule", "Points" -> 12},
{"ClenshawCurtisRule", "Points" -> 3},
{"TrapezoidalRule", "Points" -> 5},
{"TrapezoidalRule", "Points" -> 8}},
MaxRecursion -> 2]
(* 301901. *)
If you want to use different integration strategies per axis, with you have to use NIntegrate's plug-in framework. See How to implement custom NIntegrate integration strategies? .
For each Method i want to use different values of MinRecursion, MaxRecursion.
Instead of specifying MinRecursion per axis we can use the range specifications (to the same effect):
NIntegrate[
f[x, y, w, z],
{x, 0, Sequence @@
Rescale[Range[0, 1, 0.1][[2 ;; -2]], {0, 1}, {0, 2*Pi}], 2*Pi},
{y, 2, Sequence @@
Rescale[Range[0, 1, 0.25][[2 ;; -2]], {0, 1}, {2, 10}], 10},
{w, Pi/2,
Sequence @@
Rescale[Range[0, 1, 0.25][[2 ;; -2]], {0, 1}, {Pi/2, 32*Pi}], 32*Pi},
{z, 0, Sequence @@ Range[0, 1, 0.1][[2 ;; -2]], 1},
Method ->
{{"GaussKronrodRule", "Points" -> 3},
{"ClenshawCurtisRule", "Points" -> 3},
{"TrapezoidalRule", "Points" -> 5},
{"TrapezoidalRule", "Points" -> 4}},
MaxRecursion -> 2]
(* 301901. *)
Specifying max recursion per axis with the standard NIntegrate methods is not implemented.
I would say such feature would be similar to having MaxPoints specifications per axis.
I do not think, though, that those features are needed that much. Just, nice to have and low in the priority list.
If different integration strategies per axis are implemented (as mentioned above),then, of course, different axes can have different MaxRecursion values.
As @MichaelE2 pointed out in a comment, using Cartesian product rules for multi-dimensional integrals can be computationally expensive. (Even more so, if coupled with large "min recursion" partitioning of the integration domain.)
MinRecursionon an axis withEvaluate[{t, Subdivide[a, b, 2^mr]}], whereaandbare the (numerical) limits on the interval fortandmris a nonnegative integer representing the level of recursion. I don't think you can specify individual values forMaxRecursion, except maybe by writing a custom integration method. -- That said, a cartesian product of four one-dimensional integration methods will usually be very expensive. – Michael E2 Mar 05 '21 at 13:27