Skip to main content
Improved formatting
Source Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774

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.

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}]

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]

Nspher[l_, k_] := 
 NIntegrate[
  SphericalHarmonicY[l, 0, θ, φ] SphericalHarmonicY[k, 0, θ, φ]*Sin[θ],
  {θ, 0, π}, {φ, 0, 2 π},
  WorkingPrecision -> 50, AccuracyGoal -> 10, MaxRecursion -> 30]

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]

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, θ, φ] SphericalHarmonicY[k, 0, θ, φ]*Sin[θ],
  {θ, 0, π}, {φ, 0, 2 π},
  WorkingPrecision -> 50, AccuracyGoal -> 10, MaxRecursion -> 30]
added 376 characters in body
Source Link

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]

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.

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]

Source Link

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.