 |
 |
|
 |
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 15:36:55
Message: <4d6ffbe6@news.povray.org>
|
|
 |
|  |
|  |
|
 |
In another forum I was pondering about the gravity field of a torus
(ie. imagine you had eg. a torus-shaped planet: What would be the direction
and strength of gravity at different points on its surface?)
Two possibilities were suggested: The analytical (and thus exact) way,
which would require solving a complicated volume (ie. triple) integral,
and numerical approximation.
The numerical approximation is simpler in principle, but there are some
difficulties.
One way to numerically approximate the result would be to fill the torus
with point masses and then sum up their gravity on the tested location.
If we assume that the torus has even density, filling it up with point
masses is actually non-trivial.
There are two possibilities:
1) All the point masses have the same mass (ie. the total mass of the
torus divided by the number of points) and are distributed evenly inside
the torus. This is a bit problematic because coming up with an even
distribution of points inside a torus is not easy. Basically it would
mean that you would have to divide the torus into polyhedrons of the
same volume, and put the point masses at their center. However, subdividing
a torus into polyhedrons of the same volume is not trivial.
2) Instead, we subdivide the torus into polyhedrons of arbitrary size
and scale the mass of the points in relation to the volume of the polyhedron.
(In other words, the masses are scaled according to the local point
density.)
The second option might be the easiest to do, as it allows for a simple
distribution function for the points which does not need to be strictly
even.
The easiest division of the torus would be to divide it into slices,
each slice is divided into sections (each such section would thus
effectively be a pyramid with the base on the surface of the torus and
the apex on the central major-radius circle of the torus), and then each
section into polyhedrons (from the base towards the apex of the pyramid).
One way to easily achieve this programmatically is to simply create
points on the surface of toruses of increasing minor radius (the major
radius being the same as the original torus we are dealing with).
The problem is deciding what the mass of these points should be. As said,
they can't have equal mass because else you would end up with very uneven
density (the torus would be significantly denser deep inside and less
dense closer to the surface).
If we think about the points inside one of the slices, the masses should
be, if I understand correctly, proportional to the square of the distance
from the center. This gives you a disc of even density. (However, I'm not
sure now if there should be a constant factor involved...)
However, that alone is not enough. There's another aspect that has to
be considered: The points would be distributed less densely on the outer
rim of the torus and more densely on the inner rim. Thus they have to be
also scaled according to their distance from the center of the torus.
I'm not exactly sure what the formula would be.
Since we want the entire torus to have a certain mass m, the sum of
all the point masses have to be that. However, that's actually trivial:
Simply use whatever values are most convenient to create the points, and
then just divide by the sum of the original masses and multiply by m.
However, the exact formulas to determine the masses of the points is
a bit fuzzy to me. Perhaps someone could help a bit?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Le Forgeron
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 16:34:30
Message: <4d700966@news.povray.org>
|
|
 |
|  |
|  |
|
 |
I would go for some analysis first.
Look at the symmetry, with an even density, it would resolve to the
field from the two circle in the vertical plane with the target point
and the center of the torus.
Looks like a 2 planets field, in 2D.
Compute some particular point to adjust the values.
Such points could:
* center of torus (no gravity, hence both centers of mass are identical)
* on the external circle on the middle plane (due to symmetry, it
should behave like the whole mass was at the torus center, allowing to
adjust the apparent mass of each "circle" to keep the previous equality)
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Darren New
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 16:36:21
Message: <4d7009d5$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> In another forum I was pondering about the gravity field of a torus
> (ie. imagine you had eg. a torus-shaped planet: What would be the direction
> and strength of gravity at different points on its surface?)
>
> Two possibilities were suggested: The analytical (and thus exact) way,
> which would require solving a complicated volume (ie. triple) integral,
> and numerical approximation.
A few questions: ARe you talking about gravity in the surronding space
(i.e., flying a space ship around this planet) or are you talking about
gravity on the surface?
Just off the top of my head, it doesn't seem like it would be terribly
difficult to solve the gravity equation analytically (integrating either
over cylinders or disks-with-holes) at a bunch of points, and then
interpolate between those points for other points, assuming you're talking
about the outer-space gravity. Even on the surface, it would seem gravity
has to change smoothly and it should be pretty obvious where the inflection
points would be.
The way you're talking about slicing things up, you *are* talking about
integrating the volume to find the gravity in a particular direction. You're
just trying to figure out how to do an integration with easier shapes.
A quick google turns up http://www.mathpages.com/home/kmath402/kmath402.htm
But you probably already did that.
It also seems if you made *enough* test point masses, worrying about how to
subdivide it wouldn't be worthwhile. If your torus has radius 1, and you
slice it into 10,000 test masses, isn't that going to give you enough
accuracy? Use the digitalness of your compuations to advantage. Put mass in
a sphere if the center of the sphere is inside the torus, and calculate from
there.
I guess it depends on if you want to pre-calculate the field or whether
you're trying to do this without actually storing too much data. I usually
work on the "store lots of data" sorts of problems, so my spidey-sense is
off here.
Just don't try to work out the super-massive rotating torus gravity. :-)
--
Darren New, San Diego CA, USA (PST)
"How did he die?" "He got shot in the hand."
"That was fatal?"
"He was holding a live grenade at the time."
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 17:30:14
Message: <4d701674@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> A few questions: ARe you talking about gravity in the surronding space
> (i.e., flying a space ship around this planet) or are you talking about
> gravity on the surface?
There's no difference between those two. The gravity at any point in
space is calculated in the same way regardless of where that point is.
> Just off the top of my head, it doesn't seem like it would be terribly
> difficult to solve the gravity equation analytically (integrating either
> over cylinders or disks-with-holes)
If I understand correctly, the only way to solve it analytically is to
solve a rather complicated triple integral (ie. a volume integral). Unlike
with a sphere, the volume integral most probably cannot be simplified into
a simpler one (or if it can, it would have to be proved, and proving it
most probably requires solving the triple integral and seeing that it
reduces to a simpler integral, so you are not going to save anything).
When talking about a spherical body the situation is much simpler.
If you solve the volume integral for the gravity field (outside) of the
sphere, you'll find out that the sphere radius plays no part on the
result (as long as the radius is smaller or equal to the distance between
the point being tested and the center of the sphere). Thus the radius can
be reduced to zero (while retaining the mass), significantly simplifying
calculations. However, that's probably not the case with a torus because
it does not have the required symmetries. (If it is the case, it would
have to be demonstrated, again, probably solving the triple integral.
One could perhaps assume that the minor radius of the torus could be
reduced to zero without affecting the result, but that would have to be
proved before you can make the assumption.)
> The way you're talking about slicing things up, you *are* talking about
> integrating the volume to find the gravity in a particular direction. You're
> just trying to figure out how to do an integration with easier shapes.
No. What I'm talking about is distributing sample points evenly inside
the torus (or, more precisely, making the masses of these sample points
such that the overall mass density is even throughout the torus) for the
purpose of performing a numerical approximation.
It has nothing to do with integration.
> A quick google turns up http://www.mathpages.com/home/kmath402/kmath402.htm
> But you probably already did that.
Yes, but I'm not completely convinced that the solution presented is
valid, both because I don't fully understand all the math, and because
it may be that the author is making simplifications without proving that
they can be made without affecting the result.
Anyways, I'm not so interested in the end result as in the *process* of
getting there by numerical approximation, which is the whole point. :)
> It also seems if you made *enough* test point masses, worrying about how to
> subdivide it wouldn't be worthwhile. If your torus has radius 1, and you
> slice it into 10,000 test masses, isn't that going to give you enough
> accuracy? Use the digitalness of your compuations to advantage. Put mass in
> a sphere if the center of the sphere is inside the torus, and calculate from
> there.
The amount of points is not the problem. It's their distribution that is
(either spatial or mass).
You can't just put points of equal mass in whichever way you want inside
the torus because you easily end up with uneven density. You have to either
distribute the points evenly, or scale their masses according to the local
point density. That's the problem I'm trying to figure out.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Kevin Wampler
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 18:20:20
Message: <4d702234$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
On 3/3/2011 12:36 PM, Warp wrote:
>
> There are two possibilities:
>
> 1) All the point masses have the same mass (ie. the total mass of the
> torus divided by the number of points) and are distributed evenly inside
> the torus. This is a bit problematic because coming up with an even
> distribution of points inside a torus is not easy. Basically it would
> mean that you would have to divide the torus into polyhedrons of the
> same volume, and put the point masses at their center. However, subdividing
> a torus into polyhedrons of the same volume is not trivial.
If the torus isn't too `skinny' you could just uniformly sample a bunch
of points from its bounding box and retain only those which lie inside
the torus. You could also run marching cubes on it and put a point mass
at the center of each cube, scaling the mass of the points in the `edge'
cubes by the volume of the polyhedron which is inside the torus.
> 2) Instead, we subdivide the torus into polyhedrons of arbitrary size
> and scale the mass of the points in relation to the volume of the polyhedron.
> (In other words, the masses are scaled according to the local point
> density.)
How about you sample uniformly from a circle (either randomly or in a
grid). For each such sample you then create n points in a ring around
the torus' axis, where the mass of the each point is set proportionally
to the circumference of the ring?
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Darren New
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 19:27:24
Message: <4d7031ec$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> There's no difference between those two. The gravity at any point in
> space is calculated in the same way regardless of where that point is.
I know that. But the technique and approach to taking shortcuts can differ.
> Anyways, I'm not so interested in the end result as in the *process* of
> getting there by numerical approximation, which is the whole point. :)
Fair enough.
>> It also seems if you made *enough* test point masses, worrying about how to
>> subdivide it wouldn't be worthwhile. If your torus has radius 1, and you
>> slice it into 10,000 test masses, isn't that going to give you enough
>> accuracy? Use the digitalness of your compuations to advantage. Put mass in
>> a sphere if the center of the sphere is inside the torus, and calculate from
>> there.
>
> The amount of points is not the problem. It's their distribution that is
> (either spatial or mass).
Then make each point the size of a grain of sand, and you have a really,
really good approximation. That's what I mean.
> You can't just put points of equal mass in whichever way you want inside
> the torus because you easily end up with uneven density. You have to either
> distribute the points evenly, or scale their masses according to the local
> point density. That's the problem I'm trying to figure out.
Right. Not knowing why you want the answer, I was suggesting that you
distribute the points evenly and use lots and lots of points.
If it's just for personal interest in the puzzle of it, or you want to do it
in real time or something, then sure, that's not the best solution. :-)
--
Darren New, San Diego CA, USA (PST)
"How did he die?" "He got shot in the hand."
"That was fatal?"
"He was holding a live grenade at the time."
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 21:17:19
Message: <4d704bae@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> > The amount of points is not the problem. It's their distribution that is
> > (either spatial or mass).
> Then make each point the size of a grain of sand, and you have a really,
> really good approximation. That's what I mean.
I think there's some form of miscommunication here. Points have zero
size. That's irrelevant. The relevant thing is their mass and their
distribution.
> > You can't just put points of equal mass in whichever way you want inside
> > the torus because you easily end up with uneven density. You have to either
> > distribute the points evenly, or scale their masses according to the local
> > point density. That's the problem I'm trying to figure out.
> Right. Not knowing why you want the answer, I was suggesting that you
> distribute the points evenly and use lots and lots of points.
I explained it in my first post: I want to make a numerical approximation
of the gravity of a torus, and a way of doing that is to create point masses
inside it.
Perhaps you should read my first post again. I *want* to get an even
distribution of mass. That's my question: What formula should I use to
get it? I explained the approach in detail, it's just the specifics that
I'm after.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 21:25:13
Message: <4d704d88@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Kevin Wampler <wam### [at] u washington edu> wrote:
> On 3/3/2011 12:36 PM, Warp wrote:
> >
> > There are two possibilities:
> >
> > 1) All the point masses have the same mass (ie. the total mass of the
> > torus divided by the number of points) and are distributed evenly inside
> > the torus. This is a bit problematic because coming up with an even
> > distribution of points inside a torus is not easy. Basically it would
> > mean that you would have to divide the torus into polyhedrons of the
> > same volume, and put the point masses at their center. However, subdividing
> > a torus into polyhedrons of the same volume is not trivial.
> If the torus isn't too `skinny' you could just uniformly sample a bunch
> of points from its bounding box and retain only those which lie inside
> the torus.
There's a minor problem with that approach which might skew the result
in some cases. Basically, you are dividing the torus into small cubes and
putting the points at the center of each cube. However, some of the cubes
are not cubes because they are cut by the surface of the torus. In these
cases the point masses do not correspond to the volumes of the clipped
cubes.
(There's also the problem that some of the points will get too close
to the surface that way. If the location we are measuring the gravity
from happens to be too close to such a point, the result will be way too
high. In practice you have a small black hole near the surface of the
torus, and the test location is too close to it, skewing the result.)
> > 2) Instead, we subdivide the torus into polyhedrons of arbitrary size
> > and scale the mass of the points in relation to the volume of the polyhedron.
> > (In other words, the masses are scaled according to the local point
> > density.)
> How about you sample uniformly from a circle (either randomly or in a
> grid). For each such sample you then create n points in a ring around
> the torus' axis, where the mass of the each point is set proportionally
> to the circumference of the ring?
I think it's just easier to scale the point masses according to a simple
quadratic function. It's just the exact function I'm looking for.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Darren New
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 22:55:53
Message: <4d7062c9$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Warp wrote:
> are not cubes because they are cut by the surface of the torus. In these
> cases the point masses do not correspond to the volumes of the clipped
> cubes.
*My* point was that if these cubes were the size of sand grains, that
inaccuracy doesn't matter. That's why I asked how precise you needed the
answer. Plus, if you only sampled the gravity a foot off the surface within
a precision of grain-of-sand size, you don't have to worry about point
masses. :-)
(Note to self: Never answer in a sloppy intuitive way when Warp asks a math
question. :-)
--
Darren New, San Diego CA, USA (PST)
"How did he die?" "He got shot in the hand."
"That was fatal?"
"He was holding a live grenade at the time."
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 23:22:31
Message: <4d706906@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Darren New <dne### [at] san rr com> wrote:
> *My* point was that if these cubes were the size of sand grains, that
> inaccuracy doesn't matter. That's why I asked how precise you needed the
> answer. Plus, if you only sampled the gravity a foot off the surface within
> a precision of grain-of-sand size, you don't have to worry about point
> masses. :-)
I suppose in that sense it could perhaps work, as long as the testing
point is not closer to the surface of the torus than the half of such a
cube.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Kevin Wampler
Subject: Re: Numerical approximation of the gravity of a torus
Date: 3 Mar 2011 23:25:41
Message: <4d7069c5@news.povray.org>
|
|
 |
|  |
|  |
|
 |
On 3/3/2011 6:25 PM, Warp wrote:
>
>> If the torus isn't too `skinny' you could just uniformly sample a bunch
>> of points from its bounding box and retain only those which lie inside
>> the torus.
>
> There's a minor problem with that approach which might skew the result
> in some cases. Basically, you are dividing the torus into small cubes and
> putting the points at the center of each cube. However, some of the cubes
> are not cubes because they are cut by the surface of the torus. In these
> cases the point masses do not correspond to the volumes of the clipped
> cubes.
Of course, but Darren's point holds in this case. The marching cubes
approach fixes this if you're really concerned.
> (There's also the problem that some of the points will get too close
> to the surface that way. If the location we are measuring the gravity
> from happens to be too close to such a point, the result will be way too
> high. In practice you have a small black hole near the surface of the
> torus, and the test location is too close to it, skewing the result.)
I would think that any approach based on approximating the torus as a
bunch of point masses would have this problem.
> I think it's just easier to scale the point masses according to a simple
> quadratic function. It's just the exact function I'm looking for.
Does just scaling the mass proportionally to a point's distance from the
torus' axis not work here? If you're looking for an exact equation
based on the actual mass of the torus, just run a post-process
normalization pass where you scale the mass of each point so that they
sum to the total mass of the torus.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 02:53:32
Message: <4d709a7c@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Kevin Wampler <wam### [at] u washington edu> wrote:
> > (There's also the problem that some of the points will get too close
> > to the surface that way. If the location we are measuring the gravity
> > from happens to be too close to such a point, the result will be way too
> > high. In practice you have a small black hole near the surface of the
> > torus, and the test location is too close to it, skewing the result.)
> I would think that any approach based on approximating the torus as a
> bunch of point masses would have this problem.
Only if you start measuring inside the torus.
> > I think it's just easier to scale the point masses according to a simple
> > quadratic function. It's just the exact function I'm looking for.
> Does just scaling the mass proportionally to a point's distance from the
> torus' axis not work here? If you're looking for an exact equation
> based on the actual mass of the torus, just run a post-process
> normalization pass where you scale the mass of each point so that they
> sum to the total mass of the torus.
I explained the details in my original post.
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Le Forgeron
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 03:01:28
Message: <4d709c58$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Le 04/03/2011 03:17, Warp a écrit :
> I explained it in my first post: I want to make a numerical approximation
> of the gravity of a torus, and a way of doing that is to create point masses
> inside it.
>
> Perhaps you should read my first post again. I *want* to get an even
> distribution of mass. That's my question: What formula should I use to
> get it? I explained the approach in detail, it's just the specifics that
> I'm after.
>
Simplest distribution: along the major radius circle. Kind of 1D
distribution, evenly spaced with same masse along a circle. Easy.
Now, if you intend to refine that point inside the minor disc on the
perpendicular plane, you are in trouble for an "all the same mass"
points scheme. But that should not stop you from substituing for
instance the central point with seven points (hexagon pattern with
center), as long as you adjust the mass of each point according to its
distance from the main axis of the torus.
What can be done for 1--> 7 can be pushed further with any triangular
tiling of the circle. The points would not be even spaced, nor have all
the same mass, but it would work.
If you really want even spaced points of same mass... put a high
resolution grid (of regular tetrahedron instead of cube if you care) and
generate two set of points:
* first set is made of the center of tetrahedrons completely in the torus
* second set is made the center of tetrahedrons with at least one part
inside the torus.
Sets 1 & 2 would converge to the same when the resolution is increased,
so you can probably choose a basic test: if the center of the
tetrahedron is inside the torus, it has full mass.
About the mass of each points: the density * volume of torus divided by
the number of points!
For symmetry, it would be nice to have the hexagonal paving of the grid
to align with the plane of the torus.
Look at http://en.wikipedia.org/wiki/Sphere_packing
in particular, the regular packing. each sphere's center is a point of
your grid (cubic close packing/face centered cubic). Sample the torus
and you are done.
--
Software is like dirt - it costs time and money to change it and move it
around.
Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Kevin Wampler
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 11:30:05
Message: <4d71138d$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
On 3/3/2011 11:53 PM, Warp wrote:
>
>> Does just scaling the mass proportionally to a point's distance from the
>> torus' axis not work here?
>
> I explained the details in my original post.
Hopefully this is sufficiently precise:
def genTorusPoints(major, minor, usteps, vsteps, rsteps):
for i in xrange(usteps):
for j in xrange(vsteps):
for k in xrange(rsteps):
u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
x = (major+r*minor*cos(v))*cos(u)
y = (major+r*minor*cos(v))*sin(u)
z = r*minor*sin(v)
m = r*sqrt(x*x+y*y)
yield x, y, z, m
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 14:45:16
Message: <4d71414c@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Kevin Wampler <wam### [at] u washington edu> wrote:
> def genTorusPoints(major, minor, usteps, vsteps, rsteps):
> for i in xrange(usteps):
> for j in xrange(vsteps):
> for k in xrange(rsteps):
> u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
> x = (major+r*minor*cos(v))*cos(u)
> y = (major+r*minor*cos(v))*sin(u)
> z = r*minor*sin(v)
> m = r*sqrt(x*x+y*y)
> yield x, y, z, m
The density will not be equal because the points will be distributed more
densely deeper inside the torus than closer to the surface, without the
correspondent scaling of the mass.
As for taking into account the distance from the center on the mass, are
you sure that it's proportional to 'r' and not 'r*r'?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Kevin Wampler
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 17:29:56
Message: <4d7167e4$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
On 3/4/2011 11:45 AM, Warp wrote:
> Kevin Wampler<wam### [at] u washington edu> wrote:
>> def genTorusPoints(major, minor, usteps, vsteps, rsteps):
>> for i in xrange(usteps):
>> for j in xrange(vsteps):
>> for k in xrange(rsteps):
>> u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
>> x = (major+r*minor*cos(v))*cos(u)
>> y = (major+r*minor*cos(v))*sin(u)
>> z = r*minor*sin(v)
>> m = r*sqrt(x*x+y*y)
>> yield x, y, z, m
>
> The density will not be equal because the points will be distributed more
> densely deeper inside the torus than closer to the surface, without the
> correspondent scaling of the mass.
Since r=0 for points in the center of the `tube' and r=1 for points on
the surface, points deeper inside the torus are indeed given less mass.
> As for taking into account the distance from the center on the mass, are
> you sure that it's proportional to 'r' and not 'r*r'?
>
I'm not sure what you mean by "the center" here, but I do think that r
is correct in this case. You can think of the case of a cylinder
instead of a torus. Here, the volume of a `wedge' increases as you move
further away from the central axis, but only the volume only grows
linearly. Intuitively this is because only one of its three dimensions
grows as you move further out, but you can prove if you want by looking
at the volume of a fixed fraction of a cylindrical ring of constant
thickness as its radius increases.
We actually have a torus and not a cylinder, and the sqrt(x*x+y*y) term
takes into account the change in density due to the distance from the
torus' axis. The resulting equation is bilinear, which is maybe where
you got the intuition that it should be quadratic from.
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 4 Mar 2011 17:50:14
Message: <4d716ca5@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Kevin Wampler <wam### [at] u washington edu> wrote:
> On 3/4/2011 11:45 AM, Warp wrote:
> > Kevin Wampler<wam### [at] u washington edu> wrote:
> >> def genTorusPoints(major, minor, usteps, vsteps, rsteps):
> >> for i in xrange(usteps):
> >> for j in xrange(vsteps):
> >> for k in xrange(rsteps):
> >> u, v, r = 2*i*pi/usteps, 2*j*pi/vsteps, (k+1.0)/rsteps
> >> x = (major+r*minor*cos(v))*cos(u)
> >> y = (major+r*minor*cos(v))*sin(u)
> >> z = r*minor*sin(v)
> >> m = r*sqrt(x*x+y*y)
> >> yield x, y, z, m
> >
> > The density will not be equal because the points will be distributed more
> > densely deeper inside the torus than closer to the surface, without the
> > correspondent scaling of the mass.
> Since r=0 for points in the center of the `tube' and r=1 for points on
> the surface, points deeper inside the torus are indeed given less mass.
I misintepreted the meaning of 'r'.
> I'm not sure what you mean by "the center" here, but I do think that r
> is correct in this case. You can think of the case of a cylinder
> instead of a torus. Here, the volume of a `wedge' increases as you move
> further away from the central axis, but only the volume only grows
> linearly. Intuitively this is because only one of its three dimensions
> grows as you move further out, but you can prove if you want by looking
> at the volume of a fixed fraction of a cylindrical ring of constant
> thickness as its radius increases.
The two outer loops are subdividing the torus into pyramid-shaped
volumes (with the apex at the center of the "tube" and the base at
the surface of the torus). The inner loops then subdivides this pyramid
into parts from apex to base at even steps.
Two of the dimensions (those defined by 'u' and 'r') of these parts
remain the same, while one dimension (the one defined by 'v') increases
linearly. I suppose this means you are right: The volume of these parts
increases linearly, not quadratically. (Well, technically speaking not
really. In a cylinder they would, but in the torus it depends on which
way the pyramid is pointing to: If it's pointing towards the center of
the torus, it gets narrower towards the base, while on the other direction
it gets wider. But that's what the "sqrt(x*x+y*y)" part is addressing...)
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> One way to numerically approximate the result would be to fill the torus
> with point masses and then sum up their gravity on the tested location.
> If we assume that the torus has even density, filling it up with point
> masses is actually non-trivial.
I would have thought the easiest and trivial way is to just sample the
3D volume containing the torus in a regular grid pattern. Kind of like
creating a volume texture of the torus. You can then divide the total
mass by the number of points "inside" to figure the mass of each point
for use in the calculations. Just choose a resolution good enough for
the accuracy you require.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2011/03/03 15:36, Warp a écrit :
> In another forum I was pondering about the gravity field of a torus
> (ie. imagine you had eg. a torus-shaped planet: What would be the direction
> and strength of gravity at different points on its surface?)
>
> Two possibilities were suggested: The analytical (and thus exact) way,
> which would require solving a complicated volume (ie. triple) integral,
> and numerical approximation.
>
> The numerical approximation is simpler in principle, but there are some
> difficulties.
>
> One way to numerically approximate the result would be to fill the torus
> with point masses and then sum up their gravity on the tested location.
> If we assume that the torus has even density, filling it up with point
> masses is actually non-trivial.
>
> There are two possibilities:
>
> 1) All the point masses have the same mass (ie. the total mass of the
> torus divided by the number of points) and are distributed evenly inside
> the torus. This is a bit problematic because coming up with an even
> distribution of points inside a torus is not easy. Basically it would
> mean that you would have to divide the torus into polyhedrons of the
> same volume, and put the point masses at their center. However, subdividing
> a torus into polyhedrons of the same volume is not trivial.
>
> 2) Instead, we subdivide the torus into polyhedrons of arbitrary size
> and scale the mass of the points in relation to the volume of the polyhedron.
> (In other words, the masses are scaled according to the local point
> density.)
>
> The second option might be the easiest to do, as it allows for a simple
> distribution function for the points which does not need to be strictly
> even.
>
> The easiest division of the torus would be to divide it into slices,
> each slice is divided into sections (each such section would thus
> effectively be a pyramid with the base on the surface of the torus and
> the apex on the central major-radius circle of the torus), and then each
> section into polyhedrons (from the base towards the apex of the pyramid).
>
> One way to easily achieve this programmatically is to simply create
> points on the surface of toruses of increasing minor radius (the major
> radius being the same as the original torus we are dealing with).
>
> The problem is deciding what the mass of these points should be. As said,
> they can't have equal mass because else you would end up with very uneven
> density (the torus would be significantly denser deep inside and less
> dense closer to the surface).
>
> If we think about the points inside one of the slices, the masses should
> be, if I understand correctly, proportional to the square of the distance
> from the center. This gives you a disc of even density. (However, I'm not
> sure now if there should be a constant factor involved...)
>
> However, that alone is not enough. There's another aspect that has to
> be considered: The points would be distributed less densely on the outer
> rim of the torus and more densely on the inner rim. Thus they have to be
> also scaled according to their distance from the center of the torus.
> I'm not exactly sure what the formula would be.
>
> Since we want the entire torus to have a certain mass m, the sum of
> all the point masses have to be that. However, that's actually trivial:
> Simply use whatever values are most convenient to create the points, and
> then just divide by the sum of the original masses and multiply by m.
>
> However, the exact formulas to determine the masses of the points is
> a bit fuzzy to me. Perhaps someone could help a bit?
>
Some things to consider:
When in the hole of the torus, the gravity is only toward the plane
perpendicular to the major radius. On that plane, the gravity is zero.
Everywhere on the torus surface, gravity is biased toward the major axis.
Gravity is highest at the exterior equator and null at the interior equator.
The athmosphere would take the shape of an oblate sphere. It's thickness
would make the inside areas very dark. The iner "tropical" region could
very well be in perpetual total darkness, but relatively warm.
Alain
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2011/03/03 15:36, Warp a écrit :
> In another forum I was pondering about the gravity field of a torus
> (ie. imagine you had eg. a torus-shaped planet: What would be the direction
> and strength of gravity at different points on its surface?)
>
> Two possibilities were suggested: The analytical (and thus exact) way,
> which would require solving a complicated volume (ie. triple) integral,
> and numerical approximation.
>
> The numerical approximation is simpler in principle, but there are some
> difficulties.
>
> One way to numerically approximate the result would be to fill the torus
> with point masses and then sum up their gravity on the tested location.
> If we assume that the torus has even density, filling it up with point
> masses is actually non-trivial.
>
> There are two possibilities:
>
> 1) All the point masses have the same mass (ie. the total mass of the
> torus divided by the number of points) and are distributed evenly inside
> the torus. This is a bit problematic because coming up with an even
> distribution of points inside a torus is not easy. Basically it would
> mean that you would have to divide the torus into polyhedrons of the
> same volume, and put the point masses at their center. However, subdividing
> a torus into polyhedrons of the same volume is not trivial.
>
> 2) Instead, we subdivide the torus into polyhedrons of arbitrary size
> and scale the mass of the points in relation to the volume of the polyhedron.
> (In other words, the masses are scaled according to the local point
> density.)
>
> The second option might be the easiest to do, as it allows for a simple
> distribution function for the points which does not need to be strictly
> even.
>
> The easiest division of the torus would be to divide it into slices,
> each slice is divided into sections (each such section would thus
> effectively be a pyramid with the base on the surface of the torus and
> the apex on the central major-radius circle of the torus), and then each
> section into polyhedrons (from the base towards the apex of the pyramid).
>
> One way to easily achieve this programmatically is to simply create
> points on the surface of toruses of increasing minor radius (the major
> radius being the same as the original torus we are dealing with).
>
> The problem is deciding what the mass of these points should be. As said,
> they can't have equal mass because else you would end up with very uneven
> density (the torus would be significantly denser deep inside and less
> dense closer to the surface).
>
> If we think about the points inside one of the slices, the masses should
> be, if I understand correctly, proportional to the square of the distance
> from the center. This gives you a disc of even density. (However, I'm not
> sure now if there should be a constant factor involved...)
>
> However, that alone is not enough. There's another aspect that has to
> be considered: The points would be distributed less densely on the outer
> rim of the torus and more densely on the inner rim. Thus they have to be
> also scaled according to their distance from the center of the torus.
> I'm not exactly sure what the formula would be.
>
> Since we want the entire torus to have a certain mass m, the sum of
> all the point masses have to be that. However, that's actually trivial:
> Simply use whatever values are most convenient to create the points, and
> then just divide by the sum of the original masses and multiply by m.
>
> However, the exact formulas to determine the masses of the points is
> a bit fuzzy to me. Perhaps someone could help a bit?
>
Start with 2 points placed at the major radius.
Draw 2 circles of minor radius.
Calculate the 2D influence for those 2 circles.
Rotate around the major axis.
This assume that the density is constant.
It resolves to a static 2 body gravitic interaction.
Alain
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Le Forgeron
Subject: Re: Numerical approximation of the gravity of a torus
Date: 8 Mar 2011 11:13:53
Message: <4d7655c1$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Le 08/03/2011 16:48, Alain a écrit :
> Gravity is highest at the exterior equator and null at the interior
> equator.
I would question that second part for a demonstration.
Null at the center, ok.
Highest on the exterior equator, ok.
But null at the interior equator, it might depend on major & minor radius.
--
Software is like dirt - it costs time and money to change it and move it
around.
Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2011/03/08 11:13, Le_Forgeron a écrit :
> Le 08/03/2011 16:48, Alain a écrit :
>> Gravity is highest at the exterior equator and null at the interior
>> equator.
>
> I would question that second part for a demonstration.
>
> Null at the center, ok.
> Highest on the exterior equator, ok.
> But null at the interior equator, it might depend on major& minor radius.
>
>
At the interior equator, and anywhere on the disk it define, the gravity
is null. The mass under you is closer, but the mass over you is larger.
But, you will not notice that as the planet is spining on itself: the
centrifugal force will keep you on the ground. It will also somewat
offset the gravity bias.
Alain
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Kevin Wampler
Subject: Re: Numerical approximation of the gravity of a torus
Date: 10 Mar 2011 14:56:54
Message: <4d792d06$1@news.povray.org>
|
|
 |
|  |
|  |
|
 |
On 3/10/2011 10:59 AM, Alain wrote:
> At the interior equator, and anywhere on the disk it define, the gravity
> is null. The mass under you is closer, but the mass over you is larger.
And just how did you determine that these two factors exactly cancel out
at the interior equator?
Post a reply to this message
|
 |
|  |
|  |
|
 |
From: Warp
Subject: Re: Numerical approximation of the gravity of a torus
Date: 11 Mar 2011 12:04:30
Message: <4d7a561d@news.povray.org>
|
|
 |
|  |
|  |
|
 |
Alain <aze### [at] qwerty org> wrote:
> At the interior equator, and anywhere on the disk it define, the gravity
> is null. The mass under you is closer, but the mass over you is larger.
Can you actually prove that?
--
- Warp
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |