Archived

This topic is now archived and is closed to further replies.

Orbits, Gravity, and You

This topic is 5146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am developing a solar system simulator for my current game project, and I want to accurately model planetary orbits and gravity (within reason). My main question right now is: If the gravitational force of one space body (like the sun) pulls on another space body (a planet), what stops that planet from simply flying towards the sun and crashing into it? What force propels the planet in a circular/elliptical orbit around the sun? I have thought about simply giving each planet an "acceleration" that is constantly applied at a perpendicular angle to the direction to the sun. If I use the proper values, this could work. However, if there is an easier/more realistic way, I would love to hear about it. Also, what role does a planet''s rotation play on its orbital behavior? Thanks in advance, Mike

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If the planet just sort of "appeared" in space, and was not moving at all in relation to the sun, then it would in fact just be pulled right into the sun (eventually). It''s the fact that the planet is in motion and *really* far away from the sun which cause it to slowly spiral in, instead of just going directly there. Make no mistake, though, all the planets will eventually get eaten by the sun (or white dwarf or neutron star or whatever forms later...).

Share this post


Link to post
Share on other sites
The force of gravity pretty much points perpendicular to the direction of current motion, and so diverts the planet off its course, which would otherwise fly away from the sun.

Share this post


Link to post
Share on other sites
The planets are NOT spiraling in. They are in fact if anything, spiraling away since the sun is constantly losing mass, and hence gravitational force. But the change is so minor that the Earth and other inner planets will be devoured by the sun as it expands in its old age, long before the Earth has a chance to escape. The Moon is also slowly escaping from the Earth, but due to an entirely different reason. The Moon''s tidal forces on Earth are effectively stealing some of Earth''s orbital momentum. And so, as the Moon slowly speeds up, its orbital radius increaeses. About an inch a year if memory serves me right. In several millenia, the Moon will escape Earth, and simply become another planet in orbit about the sun.

Share this post


Link to post
Share on other sites
Warning! If you use a discrete integrator, which you will, you may get poor results; either flying away or into the sun. The quality of your (numerical) integrator is very important. I suggest a fourt-order Runge-Kutta.

If you use Newton (just add plain ol'' v*t to pos every step) you''ll diverge very quickly.

Share this post


Link to post
Share on other sites
If you're want a quick and simple simulation, just parameterize the orbits as circles.

x(t) = A*sin(time*speed + timeOffset) + xOffset
y(t) = A*cos(time*speed + timeOffset) + yOffset

Different planets would have different speed, timeOffset and x and y offsets. The speed varies as:

v^2/r = a = G*M/r^2 (circular motion)

or speed v is inversely proportional to distance from the central attracting body.

Parameterizing elliptical orbits that vary their speed continuously is somewhat more difficult.

The reason the planets don't fall into the sun can be stated in a variety of ways...

Consider that they have too much energy... gravity is a conservative force so no energy is lost when an object is acted upon by gravity. Instead, energy is equally exchanged between potential and kinetic energy of the object acted upon by the force.

Alternatively, they force always acts in the direction facing towards the attracting body... it is a "central force." When integerated, the force of gravity, which varies inversely with the square of distance to the attracting body gives rise to elliptical, hyperbolic or parabolic "orbits" depending on the amounts of energy and angular momentum possed by the object. It just works out that as the object is pulled nearer the attractor, it swings around instead of falling into it if it has any initial velocity that is not directed parallel to the direction between the object and attractor. If you write your orbit simulator, you'll observe this. It can also be shown analytically for two mutually attracting bodies.

If you give each planet a constant acceleration that's directed towards the sun, you well get only circular orbits, in which case you may as well just use parameterized orbts...

Planets can exchange angular momentum between their rotation about their axis and their rotation about another body and that body's rotation about its own axis. For example, due to tidal friction effects with the moon, the earth's rotation is currently slowing down, and the moon is moving further away from the earth. Over billions of years, the earth's rotation will eventually slow until the moon is fixed in the sky (if the sun doesn't expand into a red giant and evelop the earth and moon first). The moon is already slowed in this manner... the same side of it is always facing the earth (it's day is one month long). As the earth slow s its rotation, so will the moon slow its rotation about the earth. Pluto and Charon are already mutually tidally locked. Mercury is in a similar state, with it's day being two thirds of a year (or maybe it's the other way around...?)

Tidal friction is a much smaller effect than the large scale motions of planets and moons and such, however, and can generally be ignored for most astronomical simulation purposes.

Edit: Fourth order Runge-Kutta would work, but other methods can be effective, such as leapfrog, which is apparently better due to its theoretical reversibility and corresponding conservation of analytically conserved quantities.

[edited by - Geoff the Medio on November 7, 2003 10:36:49 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by cowsarenotevil
Wouldn''t "air" resistance eventually cause planets to fall into the sun, extremely slowly?
I think the repulsive effect of solar wind would outweigh that.

Share this post


Link to post
Share on other sites
The gravitational force between two bodies is G m1 m2 / (r^2) where G is a constant (6.67 x 10^-11), m1 is mass of body 1, m2 is mass of body 2, and r is the distance between the centers of mass of the two bodies.

Share this post


Link to post
Share on other sites
lol

a body move in a straight line motion until a force acts on it and changes his direction. Something like that... anyway, if the gravitiational pull stopped acting, the planet in orbit would fly in to space. The gravity pulls the planet inwards, but the planet''s momentum keeps it in orbit.

a simple gravitational force, as explained by space dude, with a good integrator (runge-kutta) will give you good results. You neeed good starting conditions, like the position of the planet and their velocity, so they stay in orbit. Alternatively, you can just populate a world with, say 10,000 particles, with random velocitites, and let the system stabilise itself. Eventually, it will turn into galaxies. Very cool. Obviously, with that many attractors, you need to precompute it, and play it back at 30 fps.

Share this post


Link to post
Share on other sites
if solar mass loss, planetary mass loss/win and solar radiation pressure (and other non-gravitational forces) were neglectable, planets would spiral in very slowly thereby radiating gravitational waves, according to relativity.
The reduction of orbital periods of tightly orbiting neutron stars due to emission of gravitational waves was actually measured and the measurements confirmed general relativity.

But i think general relativity iss hardly relevant for your simulation

ga

[edited by - ga on November 9, 2003 10:13:02 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by SpaceDude
there is no air in space...


Actually there's lots of rarified gas floating around up there. Not enough to breathe certainly, but, unless you're in deep, deep space, you're certainly not in a vacuum. So sure there's resistance. It's very small, but it's there.

This is a seperate issue from gravity waves, which radiate gravitational energy, but otherwise of which I know next to nothing.

There are also formulae for the actual ellipses in which planets travel. The sun is at one focus. You could store these parameterizations of the motion and avoid integration altogether.

[edited by - TerranFury on November 9, 2003 2:48:43 PM]

Share this post


Link to post
Share on other sites
quote:

Actually there''s lots of rarified gas floating around up there. Not enough to breathe certainly, but, unless you''re in deep, deep space, you''re certainly not in a vacuum. So sure there''s resistance. It''s very small, but it''s there.


however much ''air'' there is in space, it orbits along with the planets anyway, otherwise it would have fallen into the sun long since .

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
There is no vaccum in space. Quantum Mechanics explains this. Space is filled with lots of particles and energy that are very small and most last for only minute times as they go back to spacetime.

Share this post


Link to post
Share on other sites
quote:
Original post by TerranFury
There are also formulae for the actual ellipses in which planets travel. The sun is at one focus. You could store these parameterizations of the motion and avoid integration altogether.


That kinda takes away from the fun of trying to simulate the solar system... I mean, if you programmed it all from basic physics principles you could have some fun and see what happens when you add an extra planet to the solar system... etc...

Share this post


Link to post
Share on other sites
quote:
Original post by Eelco
quote:

Actually there''s lots of rarified gas floating around up there. Not enough to breathe certainly, but, unless you''re in deep, deep space, you''re certainly not in a vacuum. So sure there''s resistance. It''s very small, but it''s there.


however much ''air'' there is in space, it orbits along with the planets anyway, otherwise it would have fallen into the sun long since .



it probably would have been blown away by solar wind and radiation pressure. fine dust grains (smaller than about 0.1 µm, depending on optical properties) are also blown away by radiation pressure, slightly larger particles are orbiting the sun in slower orbits than the planets because radiation pressure partially compensates the gravitational force (radiation pressure also decreases with the square of the distance from sun)

ga

Share this post


Link to post
Share on other sites
quote:
Original post by Eelco
quote:

Actually there''s lots of rarified gas floating around up there. Not enough to breathe certainly, but, unless you''re in deep, deep space, you''re certainly not in a vacuum. So sure there''s resistance. It''s very small, but it''s there.


however much ''air'' there is in space, it orbits along with the planets anyway, otherwise it would have fallen into the sun long since .
That''s very true. Since everything in the solar system orbits in the same direction, it must be orbiting with us.

Anyway, Geoff''s explanation is excellent.

Just set the centripetal force equal to the gravitational force.

And if you''re still confused about the planets falling into the sun, think about this: When you spin a ball tied to a string around your head, is there some sort of magic "acceleration that is constantly applied at a perpendicular angle to the direction to the sun" (in your own words) being applied here? No - the only thing keeping that ball moving in a circle around your head is the force of you pulling inward on the string. (Although in reality your hand is swirling about, moving the center of rotation around, but don''t worry about that)

Share this post


Link to post
Share on other sites
Things are in orbit because they are falling towards the sun. They end up falling around the sun because they are moving so fast in a perpendicular direction. Same thing with any kind of orbit.

Share this post


Link to post
Share on other sites
Do not forget that we are also being pulled OUT of the solar system by the mass of the rest of the matter out there. (I don''t want to get into String theory and its 10 dementions, *11 for W, or wast it M theory* and stuff,...)

But yeah, in our life time, planets are basically stable, in the suns lifetime, No, we''re wobbling like drunks on speed.

Share this post


Link to post
Share on other sites
Talroth, that does not seem correct. I know little string theory, but that does not have a any relevance to this scale as far as I can see. If all the matter out side the solar system were pulling the planets out of the solar system, could you please explain which direction they are pulled in? The universe is homogenous (as far as this is concerned). And while you are at it, please explain why these forces pull the planets more than the sun?

Share this post


Link to post
Share on other sites
They don''t pull MORE than the sun, but they still PULL the planets, as well as the sun itself. If you want to try and model our solar system as close as possible, you have to add in ALL the forces you can think of. A speck of dust trillions of lightyears a way still acts on our planet enough to change its movement. Just not enought that we could give a damn before the sun burns out, but it still pulls.

Thats all part of TT, (Time Theory) and why we can never change time/time travle, as time is based off every smallest bit of whatever wherever it is, so if you change something, you eventually change ALL of the history from that point, and in the past. (Time is best seen as poly directional, even if we only view it as mono directional)

Share this post


Link to post
Share on other sites