Jump to content

[WIN/MAC/LINUX] KSP Trajectory Optimization Tool v1.6.10 [Major LVD Improvements!]


Recommended Posts

However, I still haven't figured out the more basic orbital question: how can I determine when one planetary body is crossing through the plane of a second planetary body?

I like to let MA do the work for me. Use the Rendezvous Maneuver Sequencer to get the starting orbit of the body (copy to clipboard), delete it from the bodies.ini file (make a backup of course) reload the bodies.ini file then open MA and paste the orbital data into the Initial State. Now just do with it what you will. In your case, the Graphical Analysis tool would be helpful.

Link to comment
Share on other sites

Could the issue be that the definition of a day (in seconds) is different between the two? That would dictate how your flight time bounds (in units of days) are interpreted.

A Kerbin day is 21600 seconds, and an Earth day is 86400 seconds. Could this be the problem?

Rechecking, I see that the Flight Bounds are the same elapsed time, i.e. the number of "days" in Kerbin Time is 4x the number of days in Earth Time.

-bk2w

Edited by bk2w
Link to comment
Share on other sites

I like to let MA do the work for me. Use the Rendezvous Maneuver Sequencer to get the starting orbit of the body (copy to clipboard), delete it from the bodies.ini file (make a backup of course) reload the bodies.ini file then open MA and paste the orbital data into the Initial State. Now just do with it what you will. In your case, the Graphical Analysis tool would be helpful.

A capital idea! That approach let me plot out the Latitude over Longitude for both Spaceship Eve and Spaceship Moho, as well as Latitude over Time for Eve. Compare the Latitude plots to locate the line of nodes visually and identify the latitude of crossing, then look up in the time date for the when Eve is nearest that latitude. That identifies the times to within less than 6000 seconds. Interpolate the points, and I can get an estimate that should be accurate to within a few hundred seconds.

Specifically, Eve descends through Moho's orbit at time ~3936400 seconds UT and latitude 1.9909° N Latitude. Eve ascends through Moho's orbit at time ~6799500 seconds UT and 1.9909° S latitude. Later nodes occur every 5657995 seconds. These closely align with my eyeballed numbers, as well.

All of which brings me to 15252390 seconds UT, which is when Eve descends through Moho's orbit and can be reached in a 2.6km/s transfer. I'm sure there are later transfers that could be more efficient and reach Eve at its nodes with Moho, but this was simply the first one that showed up as anything resembling possible.

Thanks for the tip, Gaiiden!

-bk2w

Link to comment
Share on other sites

Wait, if you were looking to get from Moho to Eve why didn't you just look for a transfer window via KSPTOT? Generally that takes place at periods where inclination is as small as possible

Interpolate the points, and I can get an estimate that should be accurate to within a few hundred seconds.

You need to go around and click/right-click/middle-click everything for all the tools in the graph windows. Lots of cool stuff hidden there. For example, with the Data Cursor tool selected, right-click and choose the Mouse Position selection style and you will be able to zoom in (using the zoom tool) and get specific X/Y values to many significant digits. Didja know you can alt-click to set multiple data cursors?

Link to comment
Share on other sites

Wait, if you were looking to get from Moho to Eve why didn't you just look for a transfer window via KSPTOT? Generally that takes place at periods where inclination is as small as possible

I did, but due to a bug (see above) I was getting really weird and unattainable sequences. A lot of this effort is to dig into the mechanism used by metaphor (detailed here and here) to get from LKO to LMO in about 2.9k/ms.

-bk2w

Link to comment
Share on other sites

I did, but due to a bug (see above) I was getting really weird and unattainable sequences. A lot of this effort is to dig into the mechanism used by metaphor (detailed here and here) to get from LKO to LMO in about 2.9k/ms.

-bk2w

I guess I don't understand what the bug is still. Have you tried modifying the transfer durations any? The only duration numbers that get put into the algorithm are the flight durations * the number of seconds in a day, so it should be really straight forward...

Link to comment
Share on other sites

I guess I don't understand what the bug is still. Have you tried modifying the transfer durations any? The only duration numbers that get put into the algorithm are the flight durations * the number of seconds in a day, so it should be really straight forward...

I suspect the problem lies with helper_methods/astrodynamics/lambert.mex. I believe the source code is expecting the time of flight to be expressed in Earth days. If you're passing in the number of Kerbin days, you'll get very weird answers.

-bk2w

Link to comment
Share on other sites

I suspect the problem lies with helper_methods/astrodynamics/lambert.mex. I believe the source code is expecting the time of flight to be expressed in Earth days. If you're passing in the number of Kerbin days, you'll get very weird answers.

-bk2w

Okay, I'll investigate. Thanks!

Is there a way to add other planets to the flyby sequencer? It would come in handy for those mods that add planets beond Eeloo's orbit.

Yes, you can load a bodies.ini file containing the relevant planetary information with the File menu on the main KSP TOT GUI (with the porkchop plot). :)

Link to comment
Share on other sites

Actually, could you try this new build of KSP TOT? Let me know if it works for you.

https://dl.dropboxusercontent.com/u/29126891/KSPTOT_v122_prerelease1.zip

Woohoo! It works! (Sorry, but I wasn't able to try it until now.)

Anything I should be wary of with that pre-release version, or should I go ahead and start using it?

Link to comment
Share on other sites

No worries, the pre-release is safe to use. :)

Cool, thanks. I have been, and it's made everything go much smoother. I guess in hindsight that every time I tried to optimise a mission that had SOI changes in (relatively) rapid succession, the optimiser would have been crapping out. I've been messing with this sort of mission profile for a while and hadn't been able to figure out why it just wouldn't work. I'm glad I finally posted about it!

Link to comment
Share on other sites

Hmm, the new version is giving me the following error when I try to run it. v1.2.0 seemed to be running fine before I tried v1.2.1

http://i.imgur.com/qqojNGT.png?1

Hi,

I have not seen a response to this request for info yet, although I note that Snoman314 has resolved his problem.

I have the same issue with the executable linked in message 1223.

Please advise.

I notice that this is a wrapped RAR archive. Is it possible to extract this archived directory structure as is and then just run from there?

If not, do any registry entries need to be created manually? <and so forth..>

Thanks in advance.

Edited by BruceKnowles
Link to comment
Share on other sites

Arrowstar,

Found a simple bug in the Rendezvous Sequencer: Using the Sun as the central body gets an error message of "Nonlinear constraint function is undefined at initial point. Fmincon cannot continue.". I tracked this down to the optimizer not liking 'Inf' as a return value from rendezvousNonlconFun(), which in turn comes from 'Inf' being returned by getSOIRadius(). I can get by this by editing getSOIRadius() to return something really big like 1e99 instead of Inf.

Oh yeah, and they finally rolled out R2014b and I'm giving KSPTOT a workout.

-Bk2w

Link to comment
Share on other sites

Looks like I managed to come up with another crazy mission profile that broke the mission architect's SOI transition code:

UbHxVWO.png

Here's the mission file:

https://drive.google.com/file/d/0BxfgbiRB-sRrTzhwTy1zbEhacG8/view?usp=sharing

Basically It won't plot the orbit any further than the transition out of Kerbin's SOI. I'm trying to set up a burn to Eeloo at approx 5km/s. It was working at around 2km/s.

I'm using the v1.2.2 files from the other day.

Link to comment
Share on other sites

Hmm, in hindsight it might be having trouble finding apoapsis of the sun because I've actually set up an escape trajectory, that said I also get the same problem when I try to coast to say, 120 degrees true anomaly.

Link to comment
Share on other sites

Hmm, in hindsight it might be having trouble finding apoapsis of the sun because I've actually set up an escape trajectory, that said I also get the same problem when I try to coast to say, 120 degrees true anomaly.

If you're on an escape trajectory, it's most likely hyperbolic, which means theres a range of angles on either side of 180 true anomaly that simply don't exist for that orbit. In other words, your escape orbit may never reach 120 degree true anomaly in addition to not having an apoapsis.

-bk2w

Link to comment
Share on other sites

If you're on an escape trajectory, it's most likely hyperbolic, which means theres a range of angles on either side of 180 true anomaly that simply don't exist for that orbit. In other words, your escape orbit may never reach 120 degree true anomaly in addition to not having an apoapsis.

-bk2w

I'll check, but I think I couldn't even get say, 5 degrees.

Link to comment
Share on other sites

Oh OK, yeah you're right. If I get a smaller true anomaly that is after the departure from Kerbin, it works fine. If I try to set a true anomaly that would be beyond a certain distance from the sun, then it craps out. So looks like it's just user error after all.

Link to comment
Share on other sites

Hey Arrowstar I'm trying really hard to use this tool, I can see it might be really helpful if properly used (great job!). I was wondering if there are more tutorials (I already read the kerbin-duna and the kerbin-tylo one) to better understand some functions I still can't figure out. Also, how do i open the .mat example files in the folder? Do i need to have matlab or is there another way? Thanks.

EDIT: I just had to load them from the MA itself, shame on me :D Still, if there are more tutorials out there, let me know!

Edited by JoeGood
Link to comment
Share on other sites

there aren't really any more tutorials. Just spend time trying to do what you want to do and then when you can't do it come here with a good explanation of what you're trying to do and Arrowstar (and me and some others experienced with it) will point you in the right direction and you'll just eventually pick it up as you go along. Worked for me, at least

Link to comment
Share on other sites

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...