I'm working on a virtual model of gravity in a text based game simulation (MUD game that will have planets and stars), I'm curious about what matmatic formulas are used for proper orbital mechanics, at the very liest, an attractor setup and a system to calculate orbits in this system, also planetary and even galactic drift is an eventual goal. My system would be totally fictional, but I'd also like to be able to generate a galaxy map for Celestia, or Maya (which I am familiar with the file formats at this time, and currently use for output visualization) The desire is to have a static or dynamic snapshot of planets with Celestia to see how the system's working.
I am also considering adding a backup system utility to allow me to test out the addition of new systems on future or current galactic position.
This MUD is a text based one that uses a varient of the Forth programming language to do it's work. Forth concepts of math and sintax are applied to a language set that is specific to the server. 1 1 + equils 2, for example.
 Ice

"Ramble ramble ramble, if only I could code as fast as I ramble."  Ice
Gravity Calculations, Attractors, and Game Physics.
static on the airways.
I feel... cold.
okay, codebase aside, I am just curious about formulas.
I still need to add drift, but simple question, is there a formula for determining how much two bodies would attrack each other... o.O and how insane am I for wondering that.
okay, codebase aside, I am just curious about formulas.
I still need to add drift, but simple question, is there a formula for determining how much two bodies would attrack each other... o.O and how insane am I for wondering that.
"Ramble ramble ramble, if only I could code as fast as I ramble."  Ice

 Posts: 8
 Joined: 13.01.2003
 With us: 16 years 8 months
 Location: Arizona
Something like this?
http://www.celestiaproject.net/forum/viewtopic.php?t=4990
I am working on a simple real time gravity simulation that approximates various orbiting bodies and the forces between them. I'll be happy to help.
Ok, the above equation works correctly if you want to use enormous mass values (which correspond to real world values) but in my simulation i set G == 1 unit to simplify the calculations. This way, the masses are easier to handle as round numbers like 500 or 100 or 10.
Another important equation if you want to make "an attractor setup and a system to calculate orbits in this system" is:
Fc = m v^2 / r, where m is mass, v is velocity, and r is the radius between the bodies.
This way, you can set up two bodies, such as a central star and a smaller planet that orbits it, and create a circular orbit by solving Fg = Fc, where Fg = G m1 m2 / d^2 and Fc = m1 v^2 / r. Solve for the velocity to get:
v = (+ or ) sqrt(G m2 / r) because d = r, so they cancel a bit.
This velocity is the velocity of the smaller mass for a circular orbit. It can be used to make circular orbits between 2 bodies. This can be used to create individual stable orbits in a solar system of your design.
http://www.celestiaproject.net/forum/viewtopic.php?t=4990
I am working on a simple real time gravity simulation that approximates various orbiting bodies and the forces between them. I'll be happy to help.
Ok, the above equation works correctly if you want to use enormous mass values (which correspond to real world values) but in my simulation i set G == 1 unit to simplify the calculations. This way, the masses are easier to handle as round numbers like 500 or 100 or 10.
Another important equation if you want to make "an attractor setup and a system to calculate orbits in this system" is:
Fc = m v^2 / r, where m is mass, v is velocity, and r is the radius between the bodies.
This way, you can set up two bodies, such as a central star and a smaller planet that orbits it, and create a circular orbit by solving Fg = Fc, where Fg = G m1 m2 / d^2 and Fc = m1 v^2 / r. Solve for the velocity to get:
v = (+ or ) sqrt(G m2 / r) because d = r, so they cancel a bit.
This velocity is the velocity of the smaller mass for a circular orbit. It can be used to make circular orbits between 2 bodies. This can be used to create individual stable orbits in a solar system of your design.

 Posts: 132
 Joined: 07.12.2003
 With us: 15 years 9 months
 Location: San Francisco http://www.gravitysimulator.com
Return to “Physics and Astronomy”
Who is online
Users browsing this forum: 10 guests