This is why mathematics makes my head hurt... - by catbarf
*Zaccheus* on 16/10/2007 at 19:29
Quote Posted by dvrabel
I was interested in which "simple iterative method" you used.
From my website:
Quote:
How Gravel works
The basic principles are quite simple: For each object, Gravel calculates the acceleration caused by the mass & distance of the other objects, and adds that acceleration to the object's speed. The object's speed is then added to it's current position. This is done several thousand times a second.
The (
http://www.rclsoftware.org.uk/gravel/v3/sdk/index.html) SDK includes the full source code of the algorithm (written in C).
Quote:
Eeven 32 bit floating point numbers would be more than accurate enough. The error from the numerical solution will likely outweigh any errors from the precision of the numbers.
Not at the kind of scale I use. I found that orbits decay very quickly in 32 bit.
For example, Jupiter's location is 7.7833e11 meters from the sun and the sun has a mass of 1.989e30 kilograms. That means that Jupiter's orbital speed is only 13.059e3 meters/second, which I am repeatedly adding to Jupiter's location.
Also consider its moon, Callisto, which is 1.883e9 meters from Jupiter. Jupiter has a mass of 1.9e27 kilograms so Callisto travels at a speed of 8.205e3 meters/second. So my program ends up adding something like (7.7833e11 -+ 1.883e9) + 8.205e3 several times a second.
You can check the orbital speeds here:
(
http://www.rclsoftware.org.uk/gravel/orbits.html#calculator)
On a related note:
It took all kinds of tricks to get DirectX (which uses 32 bit floats) to render these simulations with smooth lighting.
Chimpy Chompy on 16/10/2007 at 19:35
Sounds like just yer basic Euler method?
*Zaccheus* on 16/10/2007 at 20:10
Looks up Euler method.
I think Euler is similar but I'm calculating several curves at the same time and these curves influence each other.
What I'm doing is putting a bunch of objects into a 3D (or 2D) space, calculating how they would accelerate each other during 1 second (as per Newton's constant G) and then repositioning the objects according to their new velocities. These velocities (magnitude and direction) build up over time. Also, as each object moves, the directions of the accelerations change.
Here's a screenshot showing the paths of three objects:
(
http://www.rclsoftware.org.uk/images/gravel/chaotic.png)
(I should note that there was no collision detection in that simulation).
------------------------------------
But all that is completely different from what is thought to be happening regarding the universe expanding, which seems to be more like a rocket which is continually driven outward.
RocketMan on 16/10/2007 at 20:37
Quote Posted by *Zaccheus*
dvrabelRocketMan, I still don't understand the comparison with a ball being thrown in the air: Such a ball is accelerated once (when you throw/kick it), and then gravity constantly accelerates the ball towards the earth, so the ball first slows down and then reverses direction.
However, if all objects continue to be moved apart by the expansion of the universe, then we are not talking about an initial 'kick' but an ongoing moving apart of matter which gravity is fighting against. As matter moves apart, gravity should be increasingly loosing that battle, not starting to be winning it.
Think of the concept of escape velocity. You propel a stone at 11.2 km/s and neglect air resistance. The further from earth the stone gets, the weaker gravity is on it...and the weaker...and weaker and yet the stone still slows down, just less and less. The question is, does the stone have enough kinetic energy to equal the potential well it is in due to gravity. At 11.1 km/s the stone will eventually stop just as the weakest remaining gravitational curvature acts on it far out in space. The universe wants to coalesce due to gravity and there's a certain potential energy that needs to be overcome for all matter to escape the potential well that gravity created long ago. That well is weakening yes, but as long as the curvature exists, the vector still draws objects inward and still slows expansion. If there is enough gravitational potential left when matter slows to 0, it will collapse again. Gravity is always losing the battle but perhaps velocity is losing it faster.
*Zaccheus* on 16/10/2007 at 21:14
RocketMan, everything you say would make sense if there had been an explosion at the start and matter had been thrown into space; ie. a single acceleration at the beginning of time.
But that is not what we are discussing here. We are talking about space, even now, coming into being and effectively pushing matter apart - so the acceleration is still taking place - not like a ball which is kicked up but like a rocket which continues to be propelled. If a rocket can take off at all, it can continue to climb (assuming it maintains its thrust).
dvrabel on 16/10/2007 at 21:24
That surprises me *Zaccheus*, the Euler method (which you are applying twice for each body) is the worst method for these sorts of things. It's error is O(h), where h is the time interval. You must be using a very small time interval relative to the path curvature for the errors not to be obvious.
I'd recommend checking out the 4th-order Runge-Kutta method. It's error is O(h^4) which is much better and it's not that more complicated to calculate.
*Zaccheus* on 16/10/2007 at 21:59
I normally use one second intervals, that's 2332800 steps for the moon going around the earth. The SDK also supports minute and hour intervals.
Thanks for the suggestion, I'll look into the methods you are talking about. I'm a programmer rather than a mathematician; I initially came up with the algorithm by applying Newton's A=M/DD to a bunch of 2D vectors and realising that I could add acceleration to velocity and add velocity to location. For a long time I did not even know about the constant G. :o
Another issue is time. On my home PC I can simulate almost 2 million seconds in just over 0.15 seconds. I'll have to see what the improved accuracy vs increased calculation time looks like, but from what you are saying it sounds like it might well be worth it.
---
Eeek, looking at 4th-order Runge-Kutta in more detail it looks quite complicated.
Is there a nice simple introduction explaining this stuff ?
RocketMan on 16/10/2007 at 23:07
Quote Posted by *Zaccheus*
RocketMan, everything you say would make sense if there had been an explosion at the start and matter had been thrown into space; ie. a single acceleration at the beginning of time.
But that is not what we are discussing here. We are talking about space, even now, coming into being and effectively pushing matter apart - so the acceleration is still taking place - not like a ball which is kicked up but like a rocket which continues to be propelled. If a rocket can take off at all, it can continue to climb (assuming it maintains its thrust).
I must say I don't really know WHAT space is....but i don't see it as being created all the time. I think Einstein saw it as a fabric and therefore we should think of it as being the same old fabric as earlier in history except that its being stretched. This stretching would not produce more force to acclerate the matter within it. We know for certain that if the topology of space is not to change then there can be no tears or discontinuities in the fabric...only smooth changes in its shape that do not include rips, knots, holes and tears. Therefore there's no real grounds to assume that new space is coming into being. New volume becomes available but this new volume is not a new entity really. Its just stretched space.
*Zaccheus* on 17/10/2007 at 10:16
Then I don't understand your answer to my question here:
(
http://www.ttlg.com/forums/showthread.php?p=1657277#post1657277)
You said I was correct about that.
Even so, if space is being stretched, what is stretching it? Is that an ongoing process (in which case gravity should still not be able to win) or was it an 'explosion' which threw out not just matter but space itself. That would imply that space itself has a velocity. This makes little sense to me.
Also, going with the fabric stretching model, wouldn't all our frames of reference stay the same, such that we would not notice the universe expanding?
I realise this is a very complex subject and perhaps there are no simple analogies which make sense without further study.
RocketMan on 17/10/2007 at 15:57
I was just gonna say....I can't really answer all these questions cuz like i said, I don't really know what space is. When I said you were right before its because i thought you were talking about new volume. What I do know is that the reason relativity works is because the relationship between velocity, time and distance is not constant, as it was thought to be 100 years ago. Since space itself is stretching and changing, frames of reference are in constant motion with respect to each other as the relative displacements are always changing. If you want to know exactly how expansion works (as I do) it'd be best to ask someone who knows a lot of these answers already. My understanding is sort of shoddy. You can try superstringtheory.com. It has a forum for pretty much everything astrophysics. We haven't even touched Higg's field yet but that was important early on in expansion because the field value was different and there was a complete lack of inertia which caused the universe to expand extremely rapidly for a time. I don't know much about the details though.