Jump to content

Does any one have the Excel muscle to make a Kerbol system orrery?


CommandantAce

Recommended Posts

The challenge is this; Use the Kerbol System parameters in an Excel spreadsheet formula to create a digital Orrery of the Kerbol system. I want to know the position of all the planets at any given time. I want to be able to visualize the motion of each planet over time. An orrey would be useful in planning transfers, encounters, and gravity assists. It could also be used to predict celestial events like eclipses and conjunctions.

A quick Google of “excel orbital motion†brings up several examples. The examples show that it can be done. My attention is focused elsewhere at the moment and can’t spend a lot of time growing my excel muscle. So I am putting the idea out there.

Who ever completes this challenged will receive the prestigious Masters degree in Brain Science from Kerbal Space Academy.

Look what this guy did with a few lines of code.

This one has a basic orbit formula. http://academic.pgcc.edu/~ssinex/excelets/

Edited by CommandantAce
Link to comment
Share on other sites

For transfer windows look at the code for mechjeb and KAC, KAC also has a per-calculated bunch of stuff, the formula and the preset data disagree on launch windows.

Excel is not an option, ever...ever. it's possible I may add this to an external app I'm developing if I can get over the remote control mod issues I'm having and release a beta version as I wanted to add launch windows to remote rocket deployment and launch,

Link to comment
Share on other sites

You can find the orbit characteristics for each body in the Kerbol system at the appropriate pages on the wiki. Those should tell you everything you need to know if you plug them into the appropriate equations, from the general shape and inclination of the orbit to the planet's position in that orbit at the start of the game.

Link to comment
Share on other sites

The key thing to know is that the celestials in KSP are "on rails" on simple Keplerian orbits. There's no secular variation, and certainly no actual physics simulation on their orbits. This makes calculating their positions at any given time pretty easy. Tools that simulate planetary motion based on gravitational forces are overkill and will actually give results that diverge from the game. All you need are the orbital elements, which you can get from the KSP Wiki or I believe from some mods, and the equations which you can probably find on Wikipedia.

With that simplicity in mind, doing it in Excel is IMHO perfectly reasonable to get static pictures at a chosen time, though I wouldn't attempt an animation in it.

Link to comment
Share on other sites

The key thing to know is that the celestials in KSP are "on rails" on simple Keplerian orbits. There's no secular variation, and certainly no actual physics simulation on their orbits. This makes calculating their positions at any given time pretty easy. Tools that simulate planetary motion based on gravitational forces are overkill and will actually give results that diverge from the game. All you need are the orbital elements, which you can get from the KSP Wiki or I believe from some mods, and the equations which you can probably find on Wikipedia.

With that simplicity in mind, doing it in Excel is IMHO perfectly reasonable to get static pictures at a chosen time, though I wouldn't attempt an animation in it.

This.

Although.. for the life of me, I can't understand why Alexmoon's site isn't the correct choice in this regard. It actually gives ideal launch windows, and shows the overall delta-V if you pick a non-optimal window. That is perfect for mission planning.

Link to comment
Share on other sites

I'm Brian, and so's my wife.

*cough* Why on (insert desired planet) would you use Excel for something like that?

alexmoon.github.io/ksp/

To the original poster: please check out the website quoted here.. its meets your needs without all the extra 'non-value-add'. Just visualizing something can be done inside KSP with the maneuver tool after you know the correct launch window.. and for that, the website is fantastic.

Link to comment
Share on other sites

I suspect that OP is faced with a Barricuda filter at his w- ... when not playing KSP and would like something portable that could be loaded on a thumbdrive.

It sounds like an interesting project that might benefit both of us. I'm too busy right now but I might be able to give this a shot next week if you still need it done.

Link to comment
Share on other sites

This.

Although.. for the life of me, I can't understand why Alexmoon's site isn't the correct choice in this regard. It actually gives ideal launch windows, and shows the overall delta-V if you pick a non-optimal window. That is perfect for mission planning.

It's perfect for mission planning, but by itself it doesn't help you visually appreciate things. Personally I do find that while I can easily make interplanetary transfers by doing what Alexmoon's calculator tells me, I don't feel I really understand them.
Link to comment
Share on other sites

The key thing to know is that the celestials in KSP are "on rails" on simple Keplerian orbits. There's no secular variation, and certainly no actual physics simulation on their orbits. This makes calculating their positions at any given time pretty easy. Tools that simulate planetary motion based on gravitational forces are overkill and will actually give results that diverge from the game. All you need are the orbital elements, which you can get from the KSP Wiki or I believe from some mods, and the equations which you can probably find on Wikipedia.

With that simplicity in mind, doing it in Excel is IMHO perfectly reasonable to get static pictures at a chosen time, though I wouldn't attempt an animation in it.

This guy smells what Ace is cooking.

Link to comment
Share on other sites

This.

Although.. for the life of me, I can't understand why Alexmoon's site isn't the correct choice in this regard. It actually gives ideal launch windows, and shows the overall delta-V if you pick a non-optimal window. That is perfect for mission planning.

To the original poster: please check out the website quoted here.. its meets your needs without all the extra 'non-value-add'. Just visualizing something can be done inside KSP with the maneuver tool after you know the correct launch window.. and for that, the website is fantastic.
I'm Brian, and so's my wife.

*cough* Why on (insert desired planet) would you use Excel for something like that?

alexmoon.github.io/ksp/

Not asking for anyone to remake a tool that already exists. An Orrery is more of an astrological tool than a calculator. After the calculations and nodes are set you may wonder what the position of the planets and moons will be when you get there. You would have to do the actual time warp and zoom all the way out in map mode to do that. You could be on a planet and not know to wait or look up to witness celestial events like a conjunction or eclipse. It is a tool that can be more useful then the few examples I've described.

Doesn't have to be excel, its just what looks easy to me. Did you see the animation in the link? It was pretty cool.

Edited by CommandantAce
Link to comment
Share on other sites

It's perfect for mission planning, but by itself it doesn't help you visually appreciate things. Personally I do find that while I can easily make interplanetary transfers by doing what Alexmoon's calculator tells me, I don't feel I really understand them.

Really?

To me an interplanetary transfer is nothing more than a Hohmann transfer writ large. What seems confusing at first is that you start in an orbit which is not the orbit you are transferring out of.. Kerbin to Duna is really Kerbin to Kerbin escape SOI to Duna.. the first is just achieving escape velocity and the other is just planning a Hohmann transfer between Kerbin's orbit and Duna's orbit. And based on the speed of the target planet when the target planet will be at the apoapsis of your transfer orbit.

And since its just a normal Hohmann transfer, you can intercept at some point other than your transfer orbit's apoapsis, with a cost of extra fuel used to 1) achieve the intercept; and 2) match speeds @ the intercept point.

I've been doing Kerbin and Mun and Minmus orbital intercepts for purposes of docking for quite a while now.. and the concepts of how to do that vs. interplanetary transfers are exactly the same.

For people looking to learn how to do interplanetary intercepts.. the BEST training ground is doing gemini type missions in Kerbin orbit where two spacecraft must reliably rendezvous and dock. I've put refueling stations around Minmus and Mun as well as Kerbin so I could do this around multiple celestial bodies.. its great practice for doing interplanetary transfers. And it also teaches about how spacecraft act in orbit based on distance from the body they are orbiting, and how to orient them for easiest docking.

Once you can reliably orbit and match orbital inclinations, make rendezvous/docking a routine maneuver and the solar system is open to you..

Link to comment
Share on other sites

Really?

To me an interplanetary transfer is nothing more than a Hohmann transfer writ large. What seems confusing at first is that you start in an orbit which is not the orbit you are transferring out of.. Kerbin to Duna is really Kerbin to Kerbin escape SOI to Duna.. the first is just achieving escape velocity and the other is just planning a Hohmann transfer between Kerbin's orbit and Duna's orbit. And based on the speed of the target planet when the target planet will be at the apoapsis of your transfer orbit.

And since its just a normal Hohmann transfer, you can intercept at some point other than your transfer orbit's apoapsis, with a cost of extra fuel used to 1) achieve the intercept; and 2) match speeds @ the intercept point.

I've been doing Kerbin and Mun and Minmus orbital intercepts for purposes of docking for quite a while now.. and the concepts of how to do that vs. interplanetary transfers are exactly the same.

For people looking to learn how to do interplanetary intercepts.. the BEST training ground is doing gemini type missions in Kerbin orbit where two spacecraft must reliably rendezvous and dock. I've put refueling stations around Minmus and Mun as well as Kerbin so I could do this around multiple celestial bodies.. its great practice for doing interplanetary transfers. And it also teaches about how spacecraft act in orbit based on distance from the body they are orbiting, and how to orient them for easiest docking.

Once you can reliably orbit and match orbital inclinations, make rendezvous/docking a routine maneuver and the solar system is open to you..

Really?

Its great that you can Hansolo transfer yourself to anywhere in so many parsecs but that is not really my point. I'm talking about a tool to visualize the Kerbol system at any point in time. A most basic description would be a series of circular graphs with time as a variable. Since it would be an app out side of the game you can pilot how ever you like. What you will have is the location of every planetary body in the Kerbol system at a glance. An Orrery can be a useful tool. The Greeks knew it and now you know it.

Link to comment
Share on other sites

Really?

Its great that you can Hansolo transfer yourself to anywhere in so many parsecs but that is not really my point. I'm talking about a tool to visualize the Kerbol system at any point in time. A most basic description would be a series of circular graphs with time as a variable. Since it would be an app out side of the game you can pilot how ever you like. What you will have is the location of every planetary body in the Kerbol system at a glance. An Orrery can be a useful tool. The Greeks knew it and now you know it.

Not Hansolo.. Hohmann.. see this:

http://en.wikipedia.org/wiki/Hohmann_transfer_orbit

I understand your request, and if someone decides.. good.. more power. In the meantime please read my original post and this post for content.. and lay off the sarcasm, trust me on this.. its not helping you make your point. Its good information I am providing.. if you don't care for it.. that is fine.. just move on. Additionally.. there are MANY write ups on doing orbital rendezvous and Hohmann transfers on this very website. They translate the general concepts of the wiki quoted above to in game actions in KSP. Its how I learned to do a Hohmann transfer and orbital rendezvous.. It can't be all that hard.. I only picked up this game 5 weeks ago.

And on the subject of orrery, I learned about them in elementary school in the 60s.. yes.. they are useful tools at visualization.. I don't deny that in the least.. Did you realize you don't need one? When you start up KSP you can go directly to the tracking station and then instead of picking something to control.. just run the simulation on the fastest time warp.. voila.. instant orrery (I realize you asked for an external tool.. and it wouldn't be as fully featured as something that could jump to a point in time.. but its better than nothing..). VERY easy to visualize what is going on there.. but a warning.. it still won't teach you about doing Hohmanns.. That is something you'll simply have to learn (assuming you are interested in fuel efficiency.. I can't know if that is important to you or not).

Edited by weezl
Link to comment
Share on other sites

So it sounds like your asking for the solution to the Kepler Problem (i.e. Given an initial position/velocity calculate the position/velocity at any given time). Excel really isn't the right tool because the numerical solution involves an iterative process. I'm not an Excel ace but I think it's possible, just a huge pain in the rear.

Here is what your looking for in Matlab form:

http://goo.gl/RCw7Ip

There's 3 functions. calcInitParams converts the Orbital Parameters from the Wiki into an intial position and velocity (i.e. ro,vo), keplersKSPFcn calculates the position and velocity for a given time, and KSPsim initializes the parameters and performs the animation. If you pass in a scalar "KSPsim(5)" it will plot the positions of all the planets at that time (5 seconds). If you pass a vector "KSPsim(1:60)" it will animate the paths for that time. If you don't pass anything it will animate for roughly one Kerbin year. Only caveat is that I don't know exactly what assumptions/simplifications were made in KSP, so my assumptions/simplifications might not exactly match up.

All the math comes from"Fundamentals of Astrodynamics", Chapter 4 in particular. I highly reccomend it if your interested in this stuff, 14 bucks on Amazon! http://www.amazon.com/Fundamentals-Astrodynamics-Dover-Aeronautical-Engineering/dp/0486600610

Edited by Greenspan
Link to comment
Share on other sites

Not Hansolo.. Hohmann.. see this:

http://en.wikipedia.org/wiki/Hohmann_transfer_orbit

I understand your request, and if someone decides.. good.. more power. In the meantime please read my original post and this post for content.. and lay off the sarcasm, trust me on this.. its not helping you make your point. Its good information I am providing.. if you don't care for it.. that is fine.. just move on. Additionally.. there are MANY write ups on doing orbital rendezvous and Hohmann transfers on this very website. They translate the general concepts of the wiki quoted above to in game actions in KSP. Its how I learned to do a Hohmann transfer and orbital rendezvous.. It can't be all that hard.. I only picked up this game 5 weeks ago.

And on the subject of orrery, I learned about them in elementary school in the 60s.. yes.. they are useful tools at visualization.. I don't deny that in the least.. Did you realize you don't need one? When you start up KSP you can go directly to the tracking station and then instead of picking something to control.. just run the simulation on the fastest time warp.. voila.. instant orrery (I realize you asked for an external tool.. and it wouldn't be as fully featured as something that could jump to a point in time.. but its better than nothing..). VERY easy to visualize what is going on there.. but a warning.. it still won't teach you about doing Hohmanns.. That is something you'll simply have to learn (assuming you are interested in fuel efficiency.. I can't know if that is important to you or not).

I was kinda hoping you were going to Rick-roll me with that link. I took the bait and sadly no. You find yourself in odd company to have no sense of humor. The second sentence of my OP is "I want to know the position of all the planets at any given time." which is the jist of it. No, you can't do that in game. Nothing to do really with how you handle your hansolo ;-P transfers. If that is what you want to discuss you should move on cuz its not helping this thread.

Link to comment
Share on other sites

So it sounds like your asking for the solution to the Kepler Problem (i.e. Given an initial position/velocity calculate the position/velocity at any given time). Excel really isn't the right tool because the numerical solution involves an iterative process. I'm not an Excel ace but I think it's possible, just a huge pain in the rear.

Here is what your looking for in Matlab form:

http://goo.gl/RCw7Ip

There's 3 functions. calcInitParams converts the Orbital Parameters from the Wiki into an intial position and velocity (i.e. ro,vo), keplersKSPFcn calculates the position and velocity for a given time, and KSPsim initializes the parameters and performs the animation. If you pass in a scalar "KSPsim(5)" it will plot the positions of all the planets at that time (5 seconds). If you pass a vector "KSPsim(1:60)" it will animate the paths for that time. If you don't pass anything it will animate for roughly one Kerbin year. Only caveat is that I don't know exactly what assumptions/simplifications were made in KSP, so my assumptions/simplifications might not exactly match up.

All the math comes from"Fundamentals of Astrodynamics", Chapter 4 in particular. I highly reccomend it if your interested in this stuff, 14 bucks on Amazon! http://www.amazon.com/Fundamentals-Astrodynamics-Dover-Aeronautical-Engineering/dp/0486600610

What am I supposed to do with this? There is no Kepler problem cuz all the planets and moons are on rails. All I want to know is where the planets are.

Link to comment
Share on other sites

What am I supposed to do with this? There is no Kepler problem cuz all the planets and moons are on rails. All I want to know is where the planets are.

... start Matlab, press play button... You said you didn't care if it was in Matlab, it's exactly what you asked for...

What exactly does "on rails" mean? I think a lot of people say that and don't really understand what it means. I interpret it to mean that KSP is not an N-body problem simulator. That is, the orbits the objects in the KSP system are not affected by the other bodies in the system (other than their parent object) but they still follow Keplers Laws.

You could simplify this by figuring out a single orbit (using the soln to Keplers problem) and simply have the animation follow that path with a given Orbital period. I guess that's how you could do it in Excel. But, that's just more work for me to give a less robust solution.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...