Message Boards Message Boards

0
|
7404 Views
|
12 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Can coordinate description cause numerical integrals to vary?

Posted 9 years ago

The title does not quite capture the issue. I have a function I am integrating over a spherical volume, actually two spherical volumes. I define a vector that originated within one volume and terminates in the second volume. I now integrate this vector function over both volumes.

When I set up the integrand in spherical coordinates vs using cylindrical coordinate...by symmetry it is easy to use either coordinate system...the numerical integration does not give the same results. There is a persistent "bias" in the spherical coordinate system. It is easy to determine which approach is in error since there is a limit each integral should parametrically approach.

If I have in fact not made an error in the integrand in one or the other coordinate system, is this outcome a possibility using numerical integation? The integrals are not analytical.

I can get into more details but first I would like to know if there is something "quirky" in Mathematica relating to such an issue.

POSTED BY: Luther Nayhm
12 Replies
Posted 9 years ago

I think I found an error.

If you would, could we take this part of the discussion off line, because it does not add to addressing my initial question.

Once we get past this issue we can resume the discussion here.

Luther@LutherNayhm.org

POSTED BY: Luther Nayhm
Posted 9 years ago
POSTED BY: Luther Nayhm

I understand you want to calculate the interaction between the two spheres. If I do it I do not find a difference between using polar or cylindrical coordinates for sphere2. See notebook. Ok., there is a small difference, but that is certainely due to numerical errors in the integration.

regards hd

Attachments:
POSTED BY: Hans Dolhaine
Posted 9 years ago
Attachments:
POSTED BY: Luther Nayhm

Interesting. But the integrand in your notebook is not a vector-function (which should have three components - ok, this gave only three independent integrands). What do you really want to do?

Could you show what you are doing in cylindrical coordinates?

And:

"except in the limit of large d, the integrand should approach a constant value of 1"

If I am not completely wrong the integrand you give in your notebook should tend to zero for d -> Infinity (Numerator d (more precisely d r1^2 r2^2 Sin[p1]Sin[p2], denominator (d^2)^(3/2) = d^3 )

POSTED BY: Hans Dolhaine
Posted 9 years ago
POSTED BY: Luther Nayhm
Posted 9 years ago

OK, attached.

Attachments:
POSTED BY: Luther Nayhm
Posted 9 years ago
Attachments:
POSTED BY: Luther Nayhm

Luther, if you could post some code it might make it easier to have a look.

POSTED BY: Jason Biggs
Posted 9 years ago

Stumped, huh? I have continued to look for a stupid error but cannot find one.

However, here's a thought. The attached plot shows a type of consistent behavior. This plot should be flat, unity, with very little slope if any. But the origin always shows a small bias and the rest of the plot shows an increase in value when it should not. Could this be a rounding error of some sort? Could the integrand be numerically integrated differently when there are as many angular functions as for this one? The denominator has the appearance of a function when integrated produces an elliptical integral, only with a more complex argument.

I have not tried to force the integration method, yet, but maybe selecting the method may change the results. I will experiment and get back with you.

Attachments:
POSTED BY: Luther Nayhm
Posted 9 years ago

I introduced various methods and rules into the numerical integration...one at a time. These are indicated in the new attachment.

While the bias appears to be an artifact of some sort, the methods used caused the results to be closer to what was expected. However, in all cases, as the variable parameter was adjusted, the results all either increase or decreased as shown in the attachment.

I am still at a loss to understand how the results can be so variable and, for me, useless.

Does the new work advance the discussion or is it hopeless bogged down in unknowns?

Attachments:
POSTED BY: Luther Nayhm

Two possible leads come to mind. One is that the overlap between the two volumes may have been incorrectly described in one of the two coordinate systems. The other is that your vector may be discontinuous precisely in the region where one coordinate system is singular.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract