I've been going completely insane with this very question, and choosing the absolute other route. I want to know where everything important in a particular system IS, how fast it's moving, and how the important distances change. (I'm thinking of having a political situation hinge on orbital positions and want it to make sense.)
In practical terms I don't recommend it :eyeroll:
Using LBB6 and significant help from Aramis, I'm figuring out orbital periods, the whole nine. I'm hoping it'll be easy to adapt to other planetary systems once I've figured it out for the one. 'Cause this is haaaaard.
This isn't (shouldn't) be that hard. I'm not familiar with B6.
Simply, orbital period is orbital circumference / orbital velocity. Orbital velocity is based simply on the distance from the primary, the mass of the planet doesn't matter (in the basic sense). So, given the orbital radius, you can calculate the velocity and period.
Let's use Earth for the moment.
Earth orbital radius = 150Mkm
Orbit size is 2*pi*r = 2*3.14159*150Mkm = 942.5Mkm
Orbital Velocity = sqrt(G * M / r)
G, Gravitational Constant = 6.674e-11. M = Mass of Sun = 2e30kg
r = 150Mkm, but that's kilometers, G is in Meters, so we need to convert r. So, r = 1.5e11m.
v = sqrt(6.674e-11 * 2e30 / 1.5e11)
= sqrt(1.3348e20 / 1.5e11)
= sqrt(8.8986675e8)
= 29830.635 m/s
If you google for earth orbit velocity around the sun, it says 30km/s -- so we're right on the ball here. So, we'll use 30km/s (vs 29.83km/s)
Once you have that, positioning the bodies is straight forward.
Aramis has been showing some X, Y calculations, so we can go from there.
Grab a piece of graph paper, put the star in the center (0, 0), draw an X and Y axis through the center.
This is a typical graph, X increases to the right, Y increases going up. The X Axis is "0 degrees". So, if a body is located at 0 degrees, it would be placed along the X axis, with X equal to the orbital radius.
Given that premise. Decide on a Zero time. Year 0 is fine for this. At year zero, ALL of the bodies are placed in the system at 0 degrees. If the regularity bothers you, add a random degree offset to each planet for their starting position.
So, take the "current date" that you want to figure this out for, let's say year 1105.
Our orbital velocity is 30km/s, let's covert that to hours. 3600 seconds per hour, so simply:
30km/s * 3600s/hr = 108,000km/hr.
Our year is 1105, and we'll for simplicity say it's first day of 1105. So, how many hours have passed since year 0? If a year is 365 days of 24 hours, then it's simply:
1105 * 365 * 24 = 9,679,800 hrs.
How far have we traveled in that time?
9,679,800hr * 108,000km/hr = 1,045,418,400,000km = 1.0454184e12km
Lets divide that by our Orbital Distance (942.5Mkm):
1.0454184e12 / 9.425e8 = 1109.2
Notice a surprise. The value is NOT 1105, it's 1109. A couple of things are happening here. One, a normal year for the Earth is a single orbit around the Sun, and we know that to be roughly 365.25 days per year, not 365. So, that's kicking in here. Also, we're rounding numbers, so that introduces error in to our calculations. But, that's ok. Small stuff to not fret over for our case.
So, 1109 orbits have passed, but there's a remainder…0.2 orbits. You can normally get this via the MOD function on most systems. That's the number we're interested in. Because each "year", the planet returns to 0, a complete orbit. We're more interested in how far past 0 it has gone for the current date.
Now, given we have the remainder, that means that we've traveled 0.2, or 20%, of the orbit. Or, better said, 20% along the circle. A circle is 360 degrees. (or 2pi radians…since most sin/cos functions work in radians).
To find out how far we've traveled, in degrees, is simply:
360deg * 0.2 = 72deg.
Now you plug that number in to Aramis' math to derive the new X, Y for the body.
You apply this to all of the bodies in the system. Just make sure you use the same value for "year" for all of them.
Here is a key point. The time we're calculating for is 1105, which is 1105 years. But what's a year? As mentioned above, it's an arbitrary number (365 days * 24 hours), rather than the actual orbit of the Earth in our example:
9.425e8km / 108,000km/hr = 8727 hours
8727hr / 24hr/day = 363.625 days (You can see the error can add up as we play fast and loose, but hey, it's close, so our math isn't completely horked).
So, if you're working on a "galactic" time standard, this all works. If you want the "year" to match the local primary planet (i.e. earth), then use the actual value of the planet (i.e. orbital length / orbital velocity). What you do NOT want to do is use the "year" for each individual planet, otherwise at the beginning of each year, all of the planets would "line up" on 0, and that's not the case.
it should be straight forward to create a spreadsheet for a system. Given the radius from the primary of each body, and the "time from zero" that you want to plot, all of the rest of the values can be derived.
So, I actually created a spreadsheet, of our current solar system (roughly).
It has a couple of graphs on it, to plot the system. For fun you can slowly change the YEAR value in the upper left, and you should be able to see the planets orbit.
This is from Numbers, exported as Excel. I was able to import it in to Googles spreadsheet (charts and all) and it seems to have worked, so hopefully it will work for you.
But once you have the X, Y, it's easy to figure out distances from the select planets you like.
Here's a DropBox link to it:
https://www.dropbox.com/s/b56ydayp2yek0rq/planets.xls?dl=0
Finally, the math isn't really hard. What CAN BE hard is keeping track of Units. That stuff can just kill you.
You'll notice in my spread sheet I have the Orbit in Millions of km, and I have the mass of the Primary in Millions of kg. Finally, I had to tweak the G constant from 6.674E−11 N⋅m^2/kg^2 to 6.67E-14 N⋅Mkm^2/Mkg^2, to make the math easier.
I find it hard dealing with a complex unit like G (since it has, well, all of them…mass, length, time...).
But you can easily derive them yourself.
For example if I wanted G in terms of AU and Solar Masses (where Earth orbit is 1 AU and our Sun is 1 Solar Mass).
I can take our Orbital Velocity:
108,000 km/hr = sqrt(G * M / r)
With M = 1 (1 solar mass) and r = 1 (AU), we get:
108,000 = sqrt(G)
108,000^2 = G
11,664,000,000 = G
And, honestly, I don't know what the Units are for that.
So, Mars, at 228Mkm, is 1.52AU, thus it's velocity in km/hr is:
sqrt(11,664,000,000 (our G) * 1 (solar masses) / 1.52)
= 87600 km/hr
Google says! 24.1km/s * 3600 s/hr = 86760.
Darn close! Math works!!
Anyway…share and enjoy.