Jump to content

[WIN/MAC/LINUX] KSP Trajectory Optimization Tool v1.6.9 [New MATLAB Version!]


Recommended Posts

5 minutes ago, dennislee said:

How can i apply to RSS/RO?? I have no idea... Plz help

It's actually very simple (if I recall correctly).

1. Have KSPTOTConnect correctly installed in the GameData subfolder of your KSP install where RSS/RO is.

2. Launch KSP, enter flight scene (with whatever vessel you like).

3. Launch KSPTOT, from the main window menu, find File/Create New Bodies File from KSP

4. KSP will fetch all the needed bodies data in RSS/RO and make a new file like the default bodies.ini with them.

5. With more than one universe configuration in KSP, you can switch KSPTOT to work with different (bodies).ini files from the menu File/Load Bodies from File

Link to comment
Share on other sites

1 hour ago, diomedea said:

It's actually very simple (if I recall correctly).

1. Have KSPTOTConnect correctly installed in the GameData subfolder of your KSP install where RSS/RO is.

2. Launch KSP, enter flight scene (with whatever vessel you like).

3. Launch KSPTOT, from the main window menu, find File/Create New Bodies File from KSP

4. KSP will fetch all the needed bodies data in RSS/RO and make a new file like the default bodies.ini with them.

5. With more than one universe configuration in KSP, you can switch KSPTOT to work with different (bodies).ini files from the menu File/Load Bodies from File

Wow Thank you! Now I could enjoy real rocket science...

Link to comment
Share on other sites

  • 2 weeks later...
36 minutes ago, Arrowstar said:

You can't pull orbits from KSP anymore?  Is that new as of the last KSP release?

I can pull orbits from vessels, but asteroids no longer show up in KSPTOT's list in "Get orbit from KSP"

Link to comment
Share on other sites

So I'm back into KSP again after some time away and of course TOT is one of the first things I've added into my install (still love this after all these months), but I'm running into a problem that I, as well as others, have run up against but in searching seems never to have been resolved, namely that the UT KSP TOT settles on for its maneuvers appears to be incorrect when imported into KSP. I'm in the process of plotting out my first flyby of Eve and have gone through the initial steps of plotting a course before uploading to KSP just to see if I've done it correctly (currently its just an impact mission before I fine tune everything), but upon uploading to KSP, the maneuver as placed is nearly 120° too early in the orbit even though the dV numbers are all correct (advancing the maneuver node ahead in UT eventually results in exactly the orbit that KSP TOT depicts without changing any of the dV values). I've gone back through the instructions several times and I'm definitely not missing any steps that aren't related to fine tuning the arrival a Eve, and I've reloaded / recreated the bodies.ini file a couple of times (I'm using the OPM mod) and have gotten the same results, so I'm at a loss as to what could be causing the program to be calculating the wrong departure time. Any help would be appreciated, either in pointing me towards a solution to this problem that I haven't been able to find in searching the thread, or in identifying the issue so I can correct it and move forward.

Thanks.

EDIT: Running into a new problem with the mission optimizer: I can run the basic "minimize distance to body" optimization easily, but then when I let it go to zero distance and then try to re-run the optimization with constraints to get my arrival to be where I'd like it to be, it stops after only one iteration and the log gives me the message "fmincon stopped because the size of the current step is less than the selected value of the step size tolerance but constraints are not satisfied to within the selected value of the constraint tolerance." This is how I always began my optimizations in the past and haven't run into this problem, did something change that prevents the program from working if the orbit results in a 0 or close to 0 distance from the body?

Edited by SpacedInvader
Link to comment
Share on other sites

On 2/2/2017 at 9:23 AM, dlrk said:

I can pull orbits from vessels, but asteroids no longer show up in KSPTOT's list in "Get orbit from KSP"

Huh, okay.  I will try to investigate this over the weekend.  If I come up with anything I'll post an update release with a fix.

14 hours ago, SpacedInvader said:

So I'm back into KSP again after some time away and of course TOT is one of the first things I've added into my install (still love this after all these months), but I'm running into a problem that I, as well as others, have run up against but in searching seems never to have been resolved, namely that the UT KSP TOT settles on for its maneuvers appears to be incorrect when imported into KSP. I'm in the process of plotting out my first flyby of Eve and have gone through the initial steps of plotting a course before uploading to KSP just to see if I've done it correctly (currently its just an impact mission before I fine tune everything), but upon uploading to KSP, the maneuver as placed is nearly 120° too early in the orbit even though the dV numbers are all correct (advancing the maneuver node ahead in UT eventually results in exactly the orbit that KSP TOT depicts without changing any of the dV values). I've gone back through the instructions several times and I'm definitely not missing any steps that aren't related to fine tuning the arrival a Eve, and I've reloaded / recreated the bodies.ini file a couple of times (I'm using the OPM mod) and have gotten the same results, so I'm at a loss as to what could be causing the program to be calculating the wrong departure time. Any help would be appreciated, either in pointing me towards a solution to this problem that I haven't been able to find in searching the thread, or in identifying the issue so I can correct it and move forward.

Thanks.

EDIT: Running into a new problem with the mission optimizer: I can run the basic "minimize distance to body" optimization easily, but then when I let it go to zero distance and then try to re-run the optimization with constraints to get my arrival to be where I'd like it to be, it stops after only one iteration and the log gives me the message "fmincon stopped because the size of the current step is less than the selected value of the step size tolerance but constraints are not satisfied to within the selected value of the constraint tolerance." This is how I always began my optimizations in the past and haven't run into this problem, did something change that prevents the program from working if the orbit results in a 0 or close to 0 distance from the body?

Regarding the main body of your post: can I get from you a stock KSP scenario that demonstrates the issue, the Mission Architect .mat file you're using for planning that also reflects the KSP scenario, and maybe a screenshot or two that depicts the issue?  That should help me troubleshoot.  Thanks!

Regarding the optimizer: I don't believe there were any major changes to the optimization code.  That message you showed means that the algorithm couldn't find anywhere to go because all moves greater than the move tolerance resulted in an increase in the value of the function (more or less).  Can you provide a *.mat file that shows the issue?  I'll look into it and see if there's something that can be done or if it's expected.  Thanks!

Link to comment
Share on other sites

22 hours ago, Arrowstar said:

Huh, okay.  I will try to investigate this over the weekend.  If I come up with anything I'll post an update release with a fix.

Regarding the main body of your post: can I get from you a stock KSP scenario that demonstrates the issue, the Mission Architect .mat file you're using for planning that also reflects the KSP scenario, and maybe a screenshot or two that depicts the issue?  That should help me troubleshoot.  Thanks!

Regarding the optimizer: I don't believe there were any major changes to the optimization code.  That message you showed means that the algorithm couldn't find anywhere to go because all moves greater than the move tolerance resulted in an increase in the value of the function (more or less).  Can you provide a *.mat file that shows the issue?  I'll look into it and see if there's something that can be done or if it's expected.  Thanks!

When you say stock KSP scenario, are you saying completely stock or just no OPM? Also does this apply to the later .MAT file you requested?

Link to comment
Share on other sites

6 hours ago, SpacedInvader said:

When you say stock KSP scenario, are you saying completely stock or just no OPM? Also does this apply to the later .MAT file you requested?

Yes, pure stock KSP would be great.  It makes it easier to determine where the issue lies by ruling out mods.  And yes, the .MAT file should please match the stock KSP scenario. :)

Link to comment
Share on other sites

hey arrowstar I've been wondering and I don't recall this being asked yet - would you be willing to integrate Whitecat's Orbital Decay mod into KSPTOT as an optional thing for people who use the mod? Or is that not really something you can add in as just an option, or something you don't want to deal with at all?

aaaaaand while I'm here a slight suggestion for Coast to Next SOI searches. Since I can only set the search as high as 100, if the search ends without an SOI hit can it update the coast event to be equal to the UT time at the end of 100 revolutions? Cause then I can just add another coast event to keep looking. Use case here is I have an asteroid captured by Mun so I know it's going to intercept Mun again at some point but it doesn't always do so within 100 revolutions

Edited by Drew Kerman
Link to comment
Share on other sites

13 minutes ago, Drew Kerman said:

hey arrowstar I've been wondering and I don't recall this being asked yet - would you be willing to integrate Whitecat's Orbital Decay mod into KSPTOT as an optional thing for people who use the mod? Or is that not really something you can add in as just an option, or something you don't want to deal with at all?

aaaaaand while I'm here a slight suggestion for Coast to Next SOI searches. Since I can only set the search as high as 100, if the search ends without an SOI hit can it update the coast event to be equal to the UT time at the end of 100 revolutions? Cause then I can just add another coast event to keep looking. Use case here is I have an asteroid captured by Mun so I know it's going to intercept Mun again at some point but it doesn't always do so within 100 revolutions

Hi!

Adding in orbit decay isn't really a possible thing, unless the author of that mod is doing some approximation trickery to reduce orbital energy over time or something.  But if he is using drag equations and solving the equations of motion directly, then it's a no go.  I'm using a two-body propagator, just like KSP does, and there's no way to integrate drag into that cleanly.

I think the solution to your "100 SoI search limit" problem would simply be to increase the limit.  I'm not sure changing the coast type would be intuitive.  What limit would you rather have?

Link to comment
Share on other sites

26 minutes ago, Arrowstar said:

But if he is using drag equations and solving the equations of motion directly, then it's a no go

yea he's trying to go full realism on things and even model yarkovsky radiation and stuff - well the link is there if you want to really look into it. But yea, I was afraid the answer would be no. I'd like the extra challenge of decay, but would rather have a full mission planner that KSPTOT provides. Plus I don't even know how I would integrate it to my Flight Tracker either, heh :P

26 minutes ago, Arrowstar said:

I think the solution to your "100 SoI search limit" problem would simply be to increase the limit.  I'm not sure changing the coast type would be intuitive.  What limit would you rather have?

well, actually I just realized that the simpler thing would be for me to just go and change the coast type to True Anomaly because when I do this, it loads up the current anomaly of the initial orbit (so if I create a new file, load an orbit from KSP, set the search to 100, create a search event that comes up empty, then go and change that same event to TA). Then I can just tell it to coast 100 times :P

But if you're going to increase the limit I'd ask in return - why have a limit at all? I mean, you should still have a default setting limiting things but why a cap on what the user can set?

Addendum

whoa, that's weird. I did a SOI search with 100 max revs for a near-kerbin asteroid looking for a hit and I got one, but when I went to change its orbit to a single rev so I could get its period the True Anomaly said it's gone 375 revs. Here's the MAT file. Just go and change the coast event to TA. Now if I don't touch anything, save and close that, the app freezes for a while and then when I open the coast event again it says 447 revs.

Oh crap, sorry I should also mention I'm still on... uhm, the last release candidate prior to the KSP v1.2.2 compatible release. You should include the version number in the About dialog.

Edited by Drew Kerman
Link to comment
Share on other sites

3 hours ago, Drew Kerman said:

But if you're going to increase the limit I'd ask in return - why have a limit at all? I mean, you should still have a default setting limiting things but why a cap on what the user can set?

Addendum

If I don't have a limit, then it is possible to run into cases where the code never finds an SoI encounter, and therefore never terminates.  This would be a Bad Thing (TM) for the user. :)

Quote

whoa, that's weird. I did a SOI search with 100 max revs for a near-kerbin asteroid looking for a hit and I got one, but when I went to change its orbit to a single rev so I could get its period the True Anomaly said it's gone 375 revs. Here's the MAT file. Just go and change the coast event to TA. Now if I don't touch anything, save and close that, the app freezes for a while and then when I open the coast event again it says 447 revs.

Thanks, I'll take a look.  Sounds perhaps problematic.

Quote

You should include the version number in the About dialog.

Done! :)  Added for next release.

Edited by Arrowstar
Link to comment
Share on other sites

3 hours ago, Arrowstar said:

If I don't have a limit, then it is possible to run into cases where the code never finds an SoI encounter, and therefore never terminates.  This would be a Bad Thing (TM) for the user. :)

Oops I did a bad job saying what I said. I meant, why is there a limit on what the user can set? I get there needs to always be a limit (that's what I meant when I said the default 3 should still be there). So I'm saying just let the user enter any number into the box. It's on them if it takes 5 minutes to propogate through all the revs :P But it will always eventually still terminate.

Link to comment
Share on other sites

8 minutes ago, Ksp Slingshooter said:

Is this mod going to be developed for Android any time in the future?

It would be cool.

Hehe, sorry, no. Your phone probably doesn't have the memory or cpu performance for something like this. The UI would be awful on a phone too. :-) 

Glad you like it though!

11 hours ago, Drew Kerman said:

Oops I did a bad job saying what I said. I meant, why is there a limit on what the user can set? I get there needs to always be a limit (that's what I meant when I said the default 3 should still be there). So I'm saying just let the user enter any number into the box. It's on them if it takes 5 minutes to propogate through all the revs :P But it will always eventually still terminate.

Because the users here are mostly laymen, I try to guide them to good inputs by imposing limits. In other words, I try to leave as little "on them" as possible because it improves the user experience. :-) 

Link to comment
Share on other sites

10 hours ago, Arrowstar said:

Because the users here are mostly laymen, I try to guide them to good inputs by imposing limits. In other words, I try to leave as little "on them" as possible because it improves the user experience. :-) 

Eh, well as things stand I think the 100 limit is fine. You can ignore my initial request that this be changed - I really should have come up with the TA switch and coast setting trick a while ago!

Also the Orbital Decay mod author has a github issue you may want to subscribe to, as I made a successful bid for him to consider in the future adding a simple decay model that KSPTOT could support.

Link to comment
Share on other sites

7 hours ago, Drew Kerman said:

Eh, well as things stand I think the 100 limit is fine. You can ignore my initial request that this be changed - I really should have come up with the TA switch and coast setting trick a while ago!

Also the Orbital Decay mod author has a github issue you may want to subscribe to, as I made a successful bid for him to consider in the future adding a simple decay model that KSPTOT could support.

Okay, sounds good about the limit. 

I've posted a comment on the github issue, thanks for pointing that out!  Is the author of the mod the one who created the ticket?

Link to comment
Share on other sites

On 2/6/2017 at 7:33 PM, Arrowstar said:

Hehe, sorry, no. Your phone probably doesn't have the memory or cpu performance for something like this. The UI would be awful on a phone too. :-) 

Phones continue to increase in power, so it's not sooo crazy an idea.  The bigger problem would would probably be tooling - I doubt it would be a simple recompile, even if Matlab did have the necessary libraries for Android/iOS.

Another interesting idea would be to do a client/server model, like Telemachus does.  There are a variety of front ends (Houston, KeRD, KONRAD, MKON, PDF) that have explored different ways to HTML-ize flight controls and orbital data, many of which would be appropriate for tablet/phone.  If KSP TOT did something similar, the main program would still run on a PC; it would just receive its inputs from an API call, and send its output back to the front-end to be displayed.

That would be a LOT of work to set up the interface and simply the UI, and almost nobody would use it.  You'd still need a good computer to run KSP TOT, so about the only advantage of this would be to avoid alt-tabbing.  (I just play the game on my main monitor, and have a second smaller monitor for browser/tools/etc).

Link to comment
Share on other sites

3 hours ago, Drew Kerman said:

Sorry to poke you on this but I need to know if this feature is possible, because if not I have to continue looking into other options. Thanks!

Hey!  Like anything, it's probably possible, but I did take a look at it and I'm not sure it would be feasible based on the amount of re-writing of the plotting code that would be required and it's limited application.  Sorry. :)

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