0
$\begingroup$

I have a function Nφ0 which depends on another two functions G1 and G2 that are being integrated numerically in a row as:

G1[r1_, r_, L_, φ0_] := 2 Sqrt[r^2 + r1^2 - 2 r r1 Cos[φ0]] - 2 Sqrt[r^2 + r1^2 - 2 r r1 Cos[φ0] + L^2] - L Log[1 + (2 L (L - Sqrt[r^2 + r1^2 - 2 r r1 Cos[φ0] + L^2]))/(r^2 + r1^2 - 2 r r1 Cos[φ0])]

and

G2[r1_, r_, L_] := 2 r r1 (-Sqrt[L^2 + (r - r1)^2] + Sqrt[(r - r1)^2] + L ArcTanh[L/Sqrt[L^2 + (r - r1)^2]])

so

Nφ0[a0_, b0_, φ0_, L_] := 1/(π (φ0 (b0^2 - a0^2) L)) NIntegrate[G2[r1, r, L] - G1[r1, r, L, φ0], {r, a0, b0}, {r1, a0, r,b0}, MinRecursion -> 9, MaxRecursion -> 40, Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 100000}]

My intention is to make a table for a certain range of values of Nφ0. I tried the following code (which has worked before for another functions) a3 = 8000;b3 = 15000

Nφ0vsLatφ0Dat = ParallelTable[{L, Nφ0[a3, b3, (10 π)/180, L 10^3], 
Nφ0[a3, b3, (30 π)/180, L 10^3], 
Nφ0[a3, b3, (60 π)/180, L 10^3], 
Nφ0[a3, b3, (90 π)/180, L 10^3], 
Nφ0[a3, b3, (120 π)/180, L 10^3], 
Nφ0[a3, b3, (150 π)/180, L 10^3], 
Nφ0[a3, b3, π, L 10^3], 
Nφ0[a3, b3, (210 π)/180, L 10^3], 
Nφ0[a3, b3, (240 π)/180, L 10^3]}, {L, 1, 100, 2}];

But I get the following error message and I don't know how to fix it

NIntegrate: The integrand (....) has evaluated to Overflow, Indeterminate, or Infinity for all \sampling points in the region with boundaries \{{0.96875`,1.`},{1.`,0.\99999991132826218264676919307505685921566573881591466488316655159`65.\954589770191}}.
$\endgroup$

1 Answer 1

1
$\begingroup$

Use LocalAdaptive instead of GlobalAdaptive. This allowes to zoom in to the points where you have problems.

The following works for me:

Nφ0[a0_, b0_, φ0_, L_] := 
 1/(π (φ0 (b0^2 - a0^2) L)) NIntegrate[
   G2[r1, r, L] - G1[r1, r, L, φ0], {r, a0, b0}, {r1, a0, r,
     b0}, MinRecursion -> 9, MaxRecursion -> 40, 
   Method -> {"LocalAdaptive"}];

Nφ0vsLatφ0Dat = 
  ParallelTable[{L, Nφ0[a3, b3, (10 π)/180, L 10^3], 
    Nφ0[a3, b3, (30 π)/180, L 10^3], 
    Nφ0[a3, b3, (60 π)/180, L 10^3], 
    Nφ0[a3, b3, (90 π)/180, L 10^3], 
    Nφ0[a3, b3, (120 π)/180, L 10^3], 
    Nφ0[a3, b3, (150 π)/180, L 10^3], 
    Nφ0[a3, b3, π, L 10^3], 
    Nφ0[a3, b3, (210 π)/180, L 10^3], 
    Nφ0[a3, b3, (240 π)/180, L 10^3]}, {L, 1, 100, 2}];
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.