Jump to content

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


Recommended Posts

Okay, something is definitely going on because it should have picked up the SoI transition...

lT58Pvf.png

That really is Day 283, it just shows it as starting from 0 instead of 1 the way UT works.

I will investigate.

Link to comment
Share on other sites

11 hours ago, Drew Kerman said:

okay I think I need to raise an issue in regards to the long-term propagation of (relatively) short-period orbits. Back in my previous run of KSA when I was doing more orbital missions I noticed that my Flight Tracker was going out of sync with the game over a period of about a week or so - the lat/lng/spd/alt data that was being displayed for a given time was no longer matching up in the game by a small but noticeable margin. I figured it was a bug in the implementation I copied from KSPTOT but never had time to look into it - I just made sure to visit the craft in the game at least once a week and update the orbital data I had stored for it.

Now I've been tracking an asteroid that got captured into Kerbin orbit this playthrough, and I have made a point of not visiting it in the game (as in loading it in flight scene) since the last time it passed through Mun's SOI - so the SFS orbital data is still time stamped several weeks ago (Day 214 to be exact). If I take that SFS data and plug it into MA it tells me that the asteroid will intercept Mun's SOI again on Day 360. However I've been keeping an eye on the asteroid in the Tracking Station in game and just noticed it's on an intercept for Mun on Day 283:

B2VHirF.png

There is nothing that should have been done to change its trajectory over time, and the game should be using the same initial orbital data that KSPTOT is pulling out of the SFS file. So how come there's an intercept already?

Stock save file is available here. Load the data from the SFS, bump the rev search to max and then coast to the next SOI

Okay, found the issue and resolved it in KSPTOT v1.5.8 pre-release 5.

The issue was this: in the SoI search code, the Mun SoI transition actually came up on the opposite side of the SoI, the "departure" side where the spacecraft would be flying away.  This is not a problem in and of itself because I have code to handle that eventuality and deal with it.  That works by taking the time of the "departure" SoI "transition" and backing off some period of time to find the "arrival" SoI transition that we actually want.  In this case, it was backing off too much time and the correct SoI transition wasn't in the bounds of the new search time span.

I have corrected the code to be (hopefully) more robust. :)

Link to comment
Share on other sites

awesome, thanks for the quick fix, glad it wasn't anything more fundamental. I really do recall seeing orbital discrepancies but I haven't yet gotten to a point in my current KSA run where I can look into it again. It's probably a mistake on my end.

I will give a closer look at the online chart plugin as soon as I have a chance. It is a paid for service but I'm pretty sure that only applies for hosting files and performing charting with their online platform - the APIs section seemed to be all open-sourced and free for use. But if it comes down to doing the personal subscription account I can swing that.

Link to comment
Share on other sites

11 minutes ago, Drew Kerman said:

I will give a closer look at the online chart plugin as soon as I have a chance. It is a paid for service but I'm pretty sure that only applies for hosting files and performing charting with their online platform - the APIs section seemed to be all open-sourced and free for use. But if it comes down to doing the personal subscription account I can swing that.

Okay, I see that now.  Appears you can write HTML files instead of using the online service.  If it really is as easy as

fig2plotly(gcf, 'offline', true);

then this should be easy... I'll look into it!  My guess is there's a catch though somewhere... nothing could actually be this simple right? :)

Link to comment
Share on other sites

16 minutes ago, Arrowstar said:

Okay, good news and bad news.

The good news is I got it to run.

The bad news is that it looks like this

Okay. Well listen, there's no rush here on this. So - unless you consider this output to be an indication that it's not going to work out I am fine with you revisiting this whenever you feel you have the time/motivation to put in the extra effort that appears is required to get it to work properly. I already appreciate that you have looked into it so quickly

Link to comment
Share on other sites

Hey @Arrowstar - I've been trying to work with the pre-release you and @Stract worked together on for RSS compatibility (thank you, by the way, for all of the hard work!). I haven't been able to reproduce the success you had with the screenshots you posted a while ago - I'm still not getting the correct rendezvous with KSP TOT. I am using RSS v12.0 and thanks again for all your help and hard work!

rIwQGTU.png

HhfFWNQ.png

Link to comment
Share on other sites

7 hours ago, gruneisen said:

Hey @Arrowstar - I've been trying to work with the pre-release you and @Stract worked together on for RSS compatibility (thank you, by the way, for all of the hard work!). I haven't been able to reproduce the success you had with the screenshots you posted a while ago - I'm still not getting the correct rendezvous with KSP TOT. I am using RSS v12.0 and thanks again for all your help and hard work!

rIwQGTU.png

HhfFWNQ.png

What pre-release are you on?  Did you select the RSS gravitational parameter option in the menu before beginning?

Link to comment
Share on other sites

6 hours ago, Arrowstar said:

What pre-release are you on?  Did you select the RSS gravitational parameter option in the menu before beginning?

I am using the pre-release 5 from yesterday, but I think I forgot to select the gravitational parameter! I'll have to verify tonight, but I'm 99% certain that is the case.

I was trying to explore an issue whereupon trying to use KSP TOT in my RSS career that is in year 11, I was getting strange results and had hoped that perhaps the correction made in pre-release 5 would address it. It didn't seem to do anything, so I started a fresh career to test how things behave at year 1 that's made drove me to post last night. But, I most likely did not switch the grav parameter.

If this is the case - would there be a way to have KSP TOT, upon reading in a bodies.ini that contains a planet named, say Earth, that it either automatically selects the correct gravitational parameter or prompts the user and asks them is they'd like to apply the RSS parameter?

Thanks for getting back to me! Cheers!

Link to comment
Share on other sites

4 hours ago, gruneisen said:

If this is the case - would there be a way to have KSP TOT, upon reading in a bodies.ini that contains a planet named, say Earth, that it either automatically selects the correct gravitational parameter or prompts the user and asks them is they'd like to apply the RSS parameter?

It's certainly possible but I'm not sure it's a good idea.  I don't want the application to be "too smart" and make life difficult down the road.  And in any event, it's only a single checkbox. :)

Link to comment
Share on other sites

18 hours ago, Arrowstar said:

What pre-release are you on?  Did you select the RSS gravitational parameter option in the menu before beginning?

Nailed it - sorry for the bonehead move and thanks for the help!

Link to comment
Share on other sites

Okay, I've been busy in Cyngus land this week, so someone help me recall here: are there any outstanding issues with the latest pre-release that anyone needs or wants resolved?  Have I missed anything?  This has been quite a complicated release so far... :)

Link to comment
Share on other sites

seems to me like the RSS folk are happy, but you'll probably want to hear it from one of them. I have nothing outstanding nor recall seeing any post that has gone unanswered/unresolved, latest pre-release has been humming along fine so far for me. You can go back to playing with your real space ships :wink::P

Link to comment
Share on other sites

14 hours ago, Arrowstar said:

Okay, I've been busy in Cyngus land this week, so someone help me recall here: are there any outstanding issues with the latest pre-release that anyone needs or wants resolved?  Have I missed anything?  This has been quite a complicated release so far... :)

Hi Arrowstar! I have one thing: for some reason two last pre-releases (with RSS gravitational parameter) has some problem with departure-arrival porkchop plot (that one on the very first page of TOT). TOT creates the diagram but then stuck on the window "Searching for optimal departure/arrival" with error sound. It happens with both GM and G(M+m) factor and with both stock and RSS bodies.

Link to comment
Share on other sites

6 hours ago, Stract said:

Hi Arrowstar! I have one thing: for some reason two last pre-releases (with RSS gravitational parameter) has some problem with departure-arrival porkchop plot (that one on the very first page of TOT). TOT creates the diagram but then stuck on the window "Searching for optimal departure/arrival" with error sound. It happens with both GM and G(M+m) factor and with both stock and RSS bodies.

Fixed!  Thanks for finding it. :)

Link to comment
Share on other sites

Sorry, I think I have one more question (I already feel myself too annoying :blush:). As far as I can tell, Mission Architect works great with RSS, but I have some doubts concerning other functions of TOT. Specifically, I have difficulty with implementing multi-flyby path into Mission Architect. Here is the image:

 

Spoiler

Earth-_Venus.jpg

I've input departure orbit, suggested by multi-flyby maneuver sequencer, into mission architect, but the orbit around Sun after transition is quite different in MA and in sequencer. I'm not sure it is a bug since the results of multi-flyby maneuver sequencer were always a bit different from MA but this difference is significant. Could you please check that all corrections you did in MA for RSS are implemented in multi-flyby maneuver sequencer too?

Link to comment
Share on other sites

On 10/6/2015 at 1:38 PM, Eunomiac said:

I have MATLAB for Linux, and would very much like a Linux-compatible build of this amazing app. I searched through this thread, and the main obstacle seemed to be a lack of people with Linux MATLAB willing to help. Is it merely a matter of compiling the code on a Linux platform, or is there more to it than that?

 

On 10/8/2015 at 4:08 PM, Arrowstar said:

Yes, basically it's just a matter of compiling it to Linux. There are a few (maybe just one) MEX files, though. You would have to compile those, as well. I think it's just down to lambert.m -> lambert.mex64 at this point.

If this is something you're interested in doing, please consult with me privately before doing so. I'm willing to talk about it, as I did with the Mac version, but the KSP TOT license does not allow you to do it independently.

I realize that I'm almost two years late to the party,  but why did nothing ever come of this? Is there a chance that it still could? I'm doing my best trying to get it working with Wine, but it's been hours and it's still not. I and many others would be eternally grateful if @Eunomiac or anyone else could help make a native Linux version.

Link to comment
Share on other sites

On 6/14/2017 at 11:43 AM, Stract said:

Sorry, I think I have one more question (I already feel myself too annoying :blush:). As far as I can tell, Mission Architect works great with RSS, but I have some doubts concerning other functions of TOT. Specifically, I have difficulty with implementing multi-flyby path into Mission Architect. Here is the image:

 

  Hide contents

Earth-_Venus.jpg

I've input departure orbit, suggested by multi-flyby maneuver sequencer, into mission architect, but the orbit around Sun after transition is quite different in MA and in sequencer. I'm not sure it is a bug since the results of multi-flyby maneuver sequencer were always a bit different from MA but this difference is significant. Could you please check that all corrections you did in MA for RSS are implemented in multi-flyby maneuver sequencer too?

Thanks for the report.  First question, you have the Grav Parameter mode set to RSS in the menu in the main GUI?

So sometimes Mission Architect and the flyby code finds different solutions because the flyby code uses a an approximation in which local gravity wells (SoIs) are infinitesimal in size.  MA actually propagates the trajectory through finite-sized SoIs.  This difference is also the primary reason that people get slightly different results when using that Compute Departure button on the main UI. :)

Anyway, as long as the results aren't radically different (years off, or inclination backwards, or something like that), it's probably okay.  I did check the code, though, and I didn't see any issues with the implementation of the RSS-related code.  That said, please continue to do a bit more checking as your time and interest allow - if you find anything that looks wrong, please let me know! :)

Link to comment
Share on other sites

7 hours ago, ruiluth said:

 

I realize that I'm almost two years late to the party,  but why did nothing ever come of this? Is there a chance that it still could? I'm doing my best trying to get it working with Wine, but it's been hours and it's still not. I and many others would be eternally grateful if @Eunomiac or anyone else could help make a native Linux version.

I'm not sure why nothing has come of it.  Every few months I usually get a question about Linux and I usually respond by saying that I'm happy to support someone who wants to do the Linux build.  It can be done, but no one usually steps up to make it happen.

That said, have you tried to WINE instructions in the OP?  People have had success with them in the past.

Link to comment
Share on other sites

2 hours ago, Arrowstar said:

Thanks for the report.  First question, you have the Grav Parameter mode set to RSS in the menu in the main GUI?

So sometimes Mission Architect and the flyby code finds different solutions because the flyby code uses a an approximation in which local gravity wells (SoIs) are infinitesimal in size.  MA actually propagates the trajectory through finite-sized SoIs.  This difference is also the primary reason that people get slightly different results when using that Compute Departure button on the main UI. :)

Anyway, as long as the results aren't radically different (years off, or inclination backwards, or something like that), it's probably okay.  I did check the code, though, and I didn't see any issues with the implementation of the RSS-related code.  That said, please continue to do a bit more checking as your time and interest allow - if you find anything that looks wrong, please let me know! :)

Thanks! I see, it makes sense. Probably since SoI's in RSS are much larger than in stock KSP, the difference between MA and Flyby calculations is also larger.

Link to comment
Share on other sites

9 hours ago, Stract said:

Thanks! I see, it makes sense. Probably since SoI's in RSS are much larger than in stock KSP, the difference between MA and Flyby calculations is also larger.

There is one other consideration. Of your departure and arrival times are not the same, then you will necessarily get a different flyby trajectory in MA. I couldn't see the MFMS desired arrival time at Venus, how does it compare to what you got in MA?

Link to comment
Share on other sites

1 hour ago, Arrowstar said:

There is one other consideration. Of your departure and arrival times are not the same, then you will necessarily get a different flyby trajectory in MA. I couldn't see the MFMS desired arrival time at Venus, how does it compare to what you got in MA?

The departure time is the same. The predictions of MFMS are more or less close to MA but from time to time it is difficult to match the trajectories between them. For example, if MSFS requires 3500 m/s prograde burn, MA optimizer gives 3400 m/s prograde and 1300m/s radial for similar flight (departure and arrival times are the same). I've asked you after couple of fruitless hours I've spent trying to put this trajectory into MA :) . 

Link to comment
Share on other sites

19 hours ago, Arrowstar said:

I'm not sure why nothing has come of it.  Every few months I usually get a question about Linux and I usually respond by saying that I'm happy to support someone who wants to do the Linux build.  It can be done, but no one usually steps up to make it happen.

That said, have you tried to WINE instructions in the OP?  People have had success with them in the past.

Well, I guess we can keep hoping someone will come along and follow through. I did try everything I could, and I managed to get everything resolved up to installing MCR. That failed with errors I didn't understand, and I couldn't find any information on how to resolve them, so I decided to give up and wait.

Link to comment
Share on other sites

Hey @Arrowstar! This might be a little frivolous, but I was thinking it would nice for the Multi-Flyby Maneuver Sequencer to have a GUI element that tracks each of the 'Best' and 'Mean' score of each run and plots them as a function of run number. I don't know how difficult it would be, but also being able to go back, select a previous run from the batch and propagate the orbital maneuvers for inspection.

This is motivated for me in part that sometimes I wonder what the final score a run converged to or, if what appeared to be a good run didn't get selected as the current best, I could go back and understand why.

Like I said - I don't think this is something that may be all that helpful, but I thought it might be interesting for me.

Thanks as always for your hard work! Cheers!

Link to comment
Share on other sites

1 hour ago, gruneisen said:

Hey @Arrowstar! This might be a little frivolous, but I was thinking it would nice for the Multi-Flyby Maneuver Sequencer to have a GUI element that tracks each of the 'Best' and 'Mean' score of each run and plots them as a function of run number. I don't know how difficult it would be, but also being able to go back, select a previous run from the batch and propagate the orbital maneuvers for inspection.

This is motivated for me in part that sometimes I wonder what the final score a run converged to or, if what appeared to be a good run didn't get selected as the current best, I could go back and understand why.

Like I said - I don't think this is something that may be all that helpful, but I thought it might be interesting for me.

Thanks as always for your hard work! Cheers!

I remember the last time I was using the MFMS I was doing this manually, saving what seemed like good results and then comparing them with later results to make sure I had what looked like the best results after multiple runs. It wasn't a huge deal to manage but of course it would indeed be nice to have this worked in to the program. I wouldn't want Arrowstar to hold up new features to work on it tho.

Which makes me wonder what he's thinking of tackling next :P Arrowstar have you done any roadmapping for new features or enhanced implementation of existing ones? Or just going wherever your interest takes you when you have the time to work on things?

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