Group Abstract Group Abstract

Message Boards Message Boards

1
|
6K Views
|
7 Replies
|
1 Total Like
View groups...
Share
Share this post:

How do I ratio to very small values and avoid rounding to unity?

Posted 12 years ago

The title is not very precise.

I am ratioing the numerical outputs of two regular integrals, whose values are very small over the domain of interest. The denominator integral is a normalization integral. The calculated values differ in the seventh decimal place. The ratio always defaults to 1.0 in Mathematica. I investigated this at a detailed level because the parametric Plot function shows strange step functions in what should be smooth data.

However, a Table of values for the two integrals over the range shows the expected plots for both functions. Except, there seems to be a "noise" element with periodically spaced small step functions that should not be there. I am trying to understand what is real and what is noise and cannot find the expressions to force the accuracy needed for the ratio to supply smooth and consistent results. I tried to force various precision and accuracy goals and limits, but nothing gives me the correct values for the ratios except my hand held calculator!! Boo!

POSTED BY: Luther Nayhm
7 Replies
POSTED BY: Daniel Lichtblau
POSTED BY: Daniel Lichtblau
Posted 12 years ago
POSTED BY: Luther Nayhm

Here are some remarks.

(1) I did some further checking. PrecisionGoal also needs tweaking. This is close to smooth, but slow.

fme[d_?NumericQ] := 
 NIntegrate[
   1000 (r1*r2*(d + z2 - z1)*
      d^2/(r1^2 + r2^2 + z1^2 + z2^2 - 2*z1*z2 - 
          2*r1*r2*Cos[t2 - t1] + d*(d + 2*z2 - 2*z1))^1.5), {t1, 0, 
    2 Pi}, {t2, 0, 2 Pi}, {z1, -1, 1}, {z2, -.27, .27}, {r1, 0, 
    Sqrt[1 - z1^2]}, {r2, 0, Sqrt[.27^2 - z2^2]}, PrecisionGoal -> 12,
    AccuracyGoal -> 15]/
  NIntegrate[
   r1*r2*1000, {t1, 0, 2 Pi}, {t2, 0, 2 Pi}, {z1, -1, 
    1}, {z2, -.27, .27}, {r1, 0, Sqrt[1 - z1^2]}, {r2, 0, 
    Sqrt[.27^2 - z2^2]}, PrecisionGoal -> 12, AccuracyGoal -> 15]

Plot[fme[d], {d, 100, 130}, AxesLabel -> {d, F (Normalized)}, 
 PlotLegends -> {"Sphere"}, PlotStyle -> {Thick}, PlotRange -> Full]

(2) Might or might not help to simplify the denominator and also not recompute it. Can even compute it exactly.

c2 = 27/100;
d2 = 16*Pi^2*
  Integrate[
   r1*r2, {z1, 0, 1}, {z2, 0, c2}, {r1, 0, Sqrt[1 - z1^2]}, {r2, 0, 
    Sqrt[c2^2 - z2^2]}]

Also you can use c2 in the numerator computations.

(3) At lower PrecisionGoal, maybe in the range 8-10, it is reasonably fast and not as jumpy but still shows jumps and smooth sections (at least 6 places out though, since the y axis points are all labeled as 1). I suspect numerical issues wherein error estimates cross a threshold and the routines either do further refinement, or do not, depending on which side of the threshold they are on.

(4) As for your other note, if you saw imaginary parts and jumps due to branch cuts in exact definite integrals involving elliptics, I am not surprised. Should you see them again, please politely remind them that they remain the bane of my existence.

POSTED BY: Daniel Lichtblau
Posted 12 years ago
POSTED BY: Luther Nayhm

Impossible to suggest much without a concrete example.

POSTED BY: Daniel Lichtblau
Posted 12 years ago
Attachments:
POSTED BY: Luther Nayhm
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard