Message Boards Message Boards

0
|
7875 Views
|
8 Replies
|
7 Total Likes
View groups...
Share
Share this post:

Regarding the volume via an implicit method

Posted 10 years ago

Greetings!

May I know how should I obtain volume of an object using an implicit method?

Regards Corse

POSTED BY: Ben Corse
8 Replies
Posted 10 years ago

Thanks a lot I.M and Adam! your guidance has been great!

POSTED BY: Ben Corse

Use the same method as for volume, but define 2D region instead and integrate over this 2D region.

I.M.

POSTED BY: Ivan Morozov
Posted 10 years ago

Oh I see, I think the first assignment method should be good enough for me at this point, although I'll look through the other methods of assignment as well.

I have input arbitrary values into a,b,c and h into the implicitregion equation (with z conditions as: z <= -h && z >= -c).

what could possibly be done to obtain the cutting plane ?

I'm assuming I have to solve for the a and b values of the ellipse equation where z = -h (i.e. at the cutting plane)? In the plot, I have set h = 1

POSTED BY: Ben Corse

Ben,

There are several ways to do it, here is an example:

In[1]:= (* with assignment *)
v = a b c h ;
a = 1 ; b = 2 ; c = 3 ; h = 4 ;
v 

Out[3]= 24

In[107]:= (* with rules *)
Clear[v, a, b, c, h] ;
v = a b c h ;
v /. {a -> 1, b -> 2, c -> 3, h -> 4}

Out[109]= 24

In[4]:= (* with function *)
Clear[v] ;
v[a_, b_, c_, h_] := a b c h ;
v[1, 2, 3, 4]

Out[6]= 24

In[7]:= (* with pure function *)
Clear[v] ;
v = #1 #2 #3 #4  &;
v[1, 2, 3, 4]

Out[9]= 24

Also see this, where useful basic concepts are explained. In general you can get all you answers from Mathematica documentation.

I.M.

POSTED BY: Ivan Morozov
Posted 10 years ago

Greetings I.M and Adam

Really appreciate the advice regarding the stated problem. Wow I didnt know the ordering of variables and adding more specific conditions made so much difference in terms of computation time. Thank you for the heads up regarding that.

Also, I'm sorry for this but could I arbitrarily assign values to a,b,c and h in Mathematica to evaluate the expression (a b h (3 c^2 - h^2) [Pi])/(3 c^2)? Say something similar to a user input stored in the variables?

Regards Corse

POSTED BY: Ben Corse

Great solution, Adam,

I was not enough patient to get Integrate[] result. In fact if you add a condition that h plane must intersect the ellipsoid than computation is almost immediate.

Volume[reg, Assumptions -> a > 0 && b > 0 && c > 0 && h > 0 && h < c]

and Integrate gives the same result as it should:

Integrate[1, {x, y, z} \[Element] reg, Assumptions -> a > 0 && b > 0 && c > 0 && h > 0 && h < c]

I.M.

POSTED BY: Ivan Morozov

Hi,

In V10 you can compute it using the built-in Volume function:

In[1]:= reg=ImplicitRegion[x^2/a^2+y^2/b^2+z^2/c^2<=1 && z<=0 && z>=-h,
        {z, y, x}];

In[2]:= Volume[reg, Assumptions->a>0 && b>0 && c>0 && h>0]

                                                       2    2
                    2 a b c Pi               a b h (3 c  - h ) Pi
Out[2]= Piecewise[{{----------, c - h < 0}}, --------------------]
                        3                               2
                                                     3 c

Note that I used the variable order {z, y, x}. Volume computation problems involving symbolic parameters are hard in general and the computation time often depends on variable ordering (that is the order in which we compute the iterated integrals). Here I put the variable z first because it appears in the extra conditions. The result was computed in 6 seconds. With variables ordered {x, y, z} the computation takes about 10 minutes.

Best regards, Adam

POSTED BY: Adam Strzebonski

Hi,

Since version 10 it's possible to integrate over specified domain with both Integrate[] and NIntegrate[] functions. Consult documentation for details. Here is an example with NIntegrate[]:

R = ImplicitRegion[
    x^2/1 + y^2 + z^2 <= 1 && -0.5 <= z <= 0.5,
    {x, y, z}
   ] ;
RegionPlot3D[R]
NIntegrate[1, {x, y, z} \[Element] R]

I.M.

POSTED BY: Ivan Morozov
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