Skip to main content
2 of 3
added 376 characters in body

NIntegrate converging too slowly when increasing size of array

I have a problem with a numerical integration. I have a 4x4x4x4 array that has for each entry an integral and I want to use NIntegrate to evaluate it. It gives me no problem, it's actually pretty fast. But if I increase the size of the array to 9x9x9x9 I get this message:

NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.

I increased the working precision already but it didn't help.

EDITED:

I put here a simplified version of my code:

B9b = Array[Nspher[#2, #4] &, {9, 9, 9, 9}, {1, 0, 1, 0}]

where

Nspher[l_, k_] := NIntegrate[ SphericalHarmonicY[l, 0, \[Theta], \[Phi]] SphericalHarmonicY[k, 0, \[Theta], \[Phi]]*Sin[\[Theta]], {\[Theta], 0, \[Pi]}, {\[Phi], 0, 2 \[Pi]}, WorkingPrecision -> 50, AccuracyGoal -> 10, MaxRecursion -> 30]