Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.4K Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

Perform a numerical integration in at table with NIntegrate?

Posted 6 years ago

I have run into a problem with a table of numerical integration results. The code that creates the apparent bug is

re = ImplicitRegion[x^2/4 + y^2 + z^2 == 1.0, {x, y, z}];
v[x0_, y0_] := 1/Sqrt[(x - x0)^2 + (y - y0)^2 + z^2];
Table[NIntegrate[
  v[xx, yy], {x, y, z} \[Element] 
   re], {xx, .85, .95, .1}, {yy, .85, .95, .1}]

For xx=.95 and yy=.85, these values are not passed to the integration routine and the resulting table is

{{16.6953, 16.2125}, {NIntegrate[v[xx, yy], {x, y, z} \[Element] re], 
15.8431}}

I do not get a similar error if I do the equivalent integration in cylindrical coordinates

v1[x0_, y0_, \[Theta]_, x_] := 
  1/Sqrt[(x - x0)^2 + (r[x] Cos[\[Theta]] - y0)^2 + 
     r[x]^2 Sin[\[Theta]]^2];
Table[NIntegrate[
  v1[xx, yy, \[Theta], x] r[x] Sqrt[1 + (x/2)^2/(4 - x^2)], {x, -2, 
   2}, {\[Theta], 0, 
   2 \[Pi]}], {xx, .85, .95, .1}, {yy, .85, .95, .1}]

for which the resulting table is

{{16.6953, 16.2125}, {16.6037, 15.8431}}
POSTED BY: Mike Luntz
POSTED BY: Henrik Schachner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard