Message Boards Message Boards

0
|
6079 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

[?] Use implicit region definition?

Posted 4 years ago

I had been trying to compute some integrals numerically over a region defined implicitly and was getting some results that didn't seem to make sense. It is possible that I am using the implicit region definition incorrectly. The following code is a simple example of results that don't seem to make sense. I think I am defining the same region in two different ways and am getting different results when integrating a function over these regions. What is going on?

r0 = Sphere[{0, 0, 0}, 1.0]
r1 = ImplicitRegion[x^2 + y^2 + z^2 <= 1., {x, y, z}]

Sphere[{0, 0, 0}, 1.]

ImplicitRegion[x^2 + y^2 + z^2 <= 1., {x, y, z}]

NIntegrate[(x + y + z)^2, {x, y, z} \[Element] r0]
NIntegrate[(x + y + z)^2, {x, y, z} \[Element] r1]

12.5664

2.51327

Edit: Never mind. I just realized that Sphere is the spherical shell and Ball is the filled sphere.

POSTED BY: Mike Luntz
2 Replies
Posted 4 years ago

My question really started when trying to demonstrate numerically that the potential of a uniformly charged spheroid surface was constant inside the surface. The results of a numeric integration over the surface for a number of points interior to it showed some variation larger than I would have expected. Investigating this led me to the question I originally posted. I still do not understand the reason for the variation of results depending on how the surface is defined.

In addition to looking into defining the spheroid surface I also looked at the calculation for a spherical surface. Surfaces were defined as

f(x,y,z)==constant

and approximations to the surface were defined as

constant<=f(x,y,z)<=constant+delta

The results for the spheroid defined as a surface varied for a range of locations interior to the surface from 21.80 to 21.86. The results for the approximation to the spheroid with delta = .01 were all constant at 0.15195, equivalent to the surface integral of 15.195. The results of the integration over a spherical surface were also confusing. The resulting integrals were all constant over location, but differed over the definition of region of integration. In particular, the results for the approximation to the sphere when defined implicitly was significantly different from the other results.

Are such differences in numeric integration results to be expected? The notebook that computed all of these test cases is attached.

Attachments:
POSTED BY: Mike Luntz

Hi,

Have you tried using Ball instead of Sphere?

r0 = Ball[{0, 0, 0}, 1.0]
r1 = ImplicitRegion[x^2 + y^2 + z^2 <= 1., {x, y, z}]
NIntegrate[(x + y + z)^2, {x, y, z} \[Element] r0]
NIntegrate[(x + y + z)^2, {x, y, z} \[Element] r1]

gives the same result (2.51327).

Cheers,

Marco

POSTED BY: Marco Thiel
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