Jump to content

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


Recommended Posts

Here is KSPTOT v1.6.3 pre-release 5.  The change log:

  • Mission Architect: Added line width to Other Spacecraft;
  • LVD: Reverted some performance optimizations because they were causing issues with tank states;
  • LVD: Fixed issues with computing throttle in graphical analysis

@Drew Kerman this should resolve the issues you've identified thus far.

Link to comment
Share on other sites

just a note about Cd - I've taken videos of two of my recent rocket ascents (this one and this one) and stopped them every second on ascent to record the Cd as displayed in the FAR data window. The 1.25m rocket had an average Cd of 0.272284211 during ascent while the 0.625/0.35m rocket had an average Cd of 0.414628409. So maybe a better default Cd value in the drag profile would be something like 0.35? Or am I looking at this wrong?

Link to comment
Share on other sites

new issue, this one regarding the stopwatches. It seems that if I use a stopwatch as a non-sequential event it is treated as just as elapsed time termination state. Here's a case file based off the default launch vehicle. Repro:

  1. open GA tool and graph liquid fuel/ox mass
  2. note that tank empties at 61.7s
  3. graph stopwatch value
  4. note stopwatch begins at 61.7s just as tank empties due to non-sequential event
  5. add new non-sequential event with a termination of stopwatch value set to 5s and an action of setting First Stage inactive
  6. open GA tool and graph stage 1 active state
  7. stage 1 should be de-activated after 5 seconds of mission time, not 5 seconds after the start of the stopwatch (66.7s MET)

For some reason even setting the lower-bound activation event to #2 didn't delay the stage inactive action either

Link to comment
Share on other sites

1 hour ago, Drew Kerman said:

just a note about Cd - I've taken videos of two of my recent rocket ascents (this one and this one) and stopped them every second on ascent to record the Cd as displayed in the FAR data window. The 1.25m rocket had an average Cd of 0.272284211 during ascent while the 0.625/0.35m rocket had an average Cd of 0.414628409. So maybe a better default Cd value in the drag profile would be something like 0.35? Or am I looking at this wrong?

No, you're correct.  The value in there is actually for a particular geometry that I came across a while ago.  In any event, it's a good idea, I've changed it to 0.3. :)

Also!  I updated the download for pre-release 5 to include the draft of my Eve Sample Return tutorial for Launch Vehicle Designer.  I would definitely appreciate a few others looking at it and providing feedback. Thanks! :)

1 minute ago, Drew Kerman said:

new issue, this one regarding the stopwatches. It seems that if I use a stopwatch as a non-sequential event it is treated as just as elapsed time termination state. Here's a case file based off the default launch vehicle. Repro:

  1. open GA tool and graph liquid fuel/ox mass
  2. note that tank empties at 61.7s
  3. graph stopwatch value
  4. note stopwatch begins at 61.7s just as tank empties due to non-sequential event
  5. add new non-sequential event with a termination of stopwatch value set to 5s and an action of setting First Stage inactive
  6. open GA tool and graph stage 1 active state
  7. stage 1 should be de-activated after 5 seconds of mission time, not 5 seconds after the start of the stopwatch (66.7s MET)

For some reason even setting the lower-bound activation event to #2 didn't delay the stage inactive action either

I'll take a look, thanks for the report. :)

Link to comment
Share on other sites

47 minutes ago, Arrowstar said:

I would definitely appreciate a few others looking at it and providing feedback. Thanks! :)

read up to 3.2.3 while eating dinner since that covered what I'm working on now. Feedback:

  • you can add a note and link in the section on drag settings to check the wiki for a tutorial on rocket drag profiles ;)
  • some incomplete/misworded sentences/phrases
    • page 32 paragraph 3 "will jettison the first when"
    • page 34 paragraph 1 "for now, leaving it a 1"
    • page 34 paragraph 3 "title it and jettison
  • seems like fig22 would fit well on the side of the previous page so the next section could start at the top of the page its currently on
Link to comment
Share on other sites

is it possible to make multiple data tips in the graph window to link up to the same X-axis value? Mainly for looking at values for the same time in a GA output using sub-plots

wait never mind I can just export them instead to look at in Excel. Derp

Edited by Drew Kerman
Link to comment
Share on other sites

so since I'm waiting on the timer issue so I can properly stage, I put a place-holder non-sequential event in so I could label it "2nd stage ignition over 30km" since that's when my 2nd stage engine pushes out at a decent 1.2 TWR. I just created the event with the label and didn't change the termination event from 0s elapsed time. LVD did not like that :P It churned over to the max simulation time. I changed the termination event to 1s and it re-worked the script fine. So maybe an issue with 0s elapsed non-sequential events in general? Dunno, I'm done for the night

Oh, maybe add that MA notes functionality into LVD? I have on occasion had some ascent things calculated outside of LVD that I wasn't ready to put into the ascent program yet and had to store in an external text file until I was ready for it some days later

Edited by Drew Kerman
Link to comment
Share on other sites

10 hours ago, Drew Kerman said:

read up to 3.2.3 while eating dinner since that covered what I'm working on now. Feedback:

  • you can add a note and link in the section on drag settings to check the wiki for a tutorial on rocket drag profiles ;)
  • some incomplete/misworded sentences/phrases
    • page 32 paragraph 3 "will jettison the first when"
    • page 34 paragraph 1 "for now, leaving it a 1"
    • page 34 paragraph 3 "title it and jettison
  • seems like fig22 would fit well on the side of the previous page so the next section could start at the top of the page its currently on

These are all resolved.  Thanks!

Link to comment
Share on other sites

14 hours ago, Drew Kerman said:

new issue, this one regarding the stopwatches. It seems that if I use a stopwatch as a non-sequential event it is treated as just as elapsed time termination state. Here's a case file based off the default launch vehicle. Repro:

  1. open GA tool and graph liquid fuel/ox mass
  2. note that tank empties at 61.7s
  3. graph stopwatch value
  4. note stopwatch begins at 61.7s just as tank empties due to non-sequential event
  5. add new non-sequential event with a termination of stopwatch value set to 5s and an action of setting First Stage inactive
  6. open GA tool and graph stage 1 active state
  7. stage 1 should be de-activated after 5 seconds of mission time, not 5 seconds after the start of the stopwatch (66.7s MET)

For some reason even setting the lower-bound activation event to #2 didn't delay the stage inactive action either

Issue resolved for next release.  This was a weird one...

12 hours ago, Drew Kerman said:

so since I'm waiting on the timer issue so I can properly stage, I put a place-holder non-sequential event in so I could label it "2nd stage ignition over 30km" since that's when my 2nd stage engine pushes out at a decent 1.2 TWR. I just created the event with the label and didn't change the termination event from 0s elapsed time. LVD did not like that :P It churned over to the max simulation time. I changed the termination event to 1s and it re-worked the script fine. So maybe an issue with 0s elapsed non-sequential events in general? Dunno, I'm done for the night

Oh, maybe add that MA notes functionality into LVD? I have on occasion had some ascent things calculated outside of LVD that I wasn't ready to put into the ascent program yet and had to store in an external text file until I was ready for it some days later

  1. Can you provide me a MAT file that demonstrates this?  I tried on the last file you provided but I couldn't reproduce.
  2. Yes, added for next release.
Link to comment
Share on other sites

Hey man, thanks for the awesome tool! I'm trying to use it to setup a simple maneuver to get from Kerbin to another planet (tried Duna and Eve), but it seems the maneuver node gets positioned at the wrong time (seems to be a few minutes off). From what I can see, everything is correct in the TOT (planets position match with the game, dv-values match), it's just that the node is not uploaded at the correct position. If I move it a few minutes, I can intercept the planet at the position it calculated.

Is there anything I can test/change? My procedure is to use get the earliest departure time from KSP (right-click -> get UT from KSP), compute Porkchop, Compute departure, get orbit parameter from active vessel (using the plugin too), compute departure burn, and then upload maneuver to KSP.

I'm using the Linux version, btw.

Link to comment
Share on other sites

1 hour ago, Drew Kerman said:

yup! here ya go. Just find the event in the non-sequential list and change the duration back to 0 and it should churn to max sim & propagation time

It has to be a MATLAB bug.  The built-in integrator's event handling just sort of stops behaving normally in this case.  I watched it completely ignore any semblance of event detection root-finding when the non-sequential event termination condition is "event duration" of 0.0 (or very close to 0.0, as in 1E-14). 

I'll keep looking at it, but for now I think just avoid non-sequential event termination conditions with event duration of 0.0. :)

Link to comment
Share on other sites

2 hours ago, vitorboschi said:

Hey man, thanks for the awesome tool! I'm trying to use it to setup a simple maneuver to get from Kerbin to another planet (tried Duna and Eve), but it seems the maneuver node gets positioned at the wrong time (seems to be a few minutes off). From what I can see, everything is correct in the TOT (planets position match with the game, dv-values match), it's just that the node is not uploaded at the correct position. If I move it a few minutes, I can intercept the planet at the position it calculated.

Is there anything I can test/change? My procedure is to use get the earliest departure time from KSP (right-click -> get UT from KSP), compute Porkchop, Compute departure, get orbit parameter from active vessel (using the plugin too), compute departure burn, and then upload maneuver to KSP.

I'm using the Linux version, btw.

So this is not unusual (it's also the single most common question when using KSPTOT lol).  The porkchop plot uses a "infinitesimal" sized sphere of influence of Kerbin, which basically means that the departure point inherits from Kerbin's position and velocity but ignores any Kerbin gravity.  Only solar gravity is used.  This assumption simplifies the problem immensely at the cost of some accuracy.  What you're finding with having the adjust the departure time a bit is that lack of perfect accuracy.

The other aspect, now that it occurs to me, is that KSPTOT doesn't necessarily know where you are in your orbit when you compute the maneuver.  (It does if you use the "Mean Anomaly" and "Epoch" checkbox when you define the initial orbit.)  If it doesn't know, it just assumes that you're in the right place in the right time.

If you do want to model maneuvers better, you can try Mission Architect or Launch Vehicle Designer, both of which will model burns exactly as KSP models them, giving you that accuracy.  These tools are more complex than the porkchop plot tool, though.

Good question!  Does that help any? :)

Link to comment
Share on other sites

10 minutes ago, Arrowstar said:

The other aspect, now that it occurs to me, is that KSPTOT doesn't necessarily know where you are in your orbit when you compute the maneuver.  (It does if you use the "Mean Anomaly" and "Epoch" checkbox when you define the initial orbit.)  If it doesn't know, it just assumes that you're in the right place in the right time

Wow, thanks for the detailed explanation! I've actually tried to use Mean Anomaly and Epoch in one of my tests, but I think it didn't made any difference. I'll try it again, just to be sure.

Your answer made it a lot more clear, and now I actually have a suggestion for you: remove the option to upload the node to KSP directly from that screen, or put a warning there suggesting to use the Mission Architect instead. The fact that I could upload the maneuver from that (after getting all the orbit parameters from the vessel) lead me (and I guess most of the other people asking you the same question :D) to believe that the maneuver node was tailor made for that vessel/orbit, and thus, should be correct already.

Link to comment
Share on other sites

3 hours ago, vitorboschi said:

Your answer made it a lot more clear, and now I actually have a suggestion for you: remove the option to upload the node to KSP directly from that screen, or put a warning there suggesting to use the Mission Architect instead. The fact that I could upload the maneuver from that (after getting all the orbit parameters from the vessel) lead me (and I guess most of the other people asking you the same question :D) to believe that the maneuver node was tailor made for that vessel/orbit, and thus, should be correct already.

A warning is a good idea.  I'll look into that.  Thanks!

Link to comment
Share on other sites

Hi everyone,

Tonight I built KSPTOT v1.6.3 pre-release 6.  Here's the change log.  All items are w.r.t. Launch Vehicle Designer.

  • Added a Mission Notes area (as in Mission Architect) - see the Edit Menu
  • Fixed issue with stop watch termination condition
  • New Cd default for aero drag state is 0.3
  • Some code refactoring in the SimulationDriver

Please let me know if you find any issues (aside from the Non-Sequential event duration termination condition issue previously reported above), or if you have any thoughts on the Eve Sample Return tutorial (which is also included in the download in this post).

Thanks!

Link to comment
Share on other sites

Hi @Arrowstar  ,one quick question: does departure/encounter dates calculated by TOT assume to match with KSP SOI leave/enter ?

For departure, I always wonder if it's not the burn date instead of SOI escape; but so far I matched with SOI solution, and it was fine, asking just to be sure:)

thanks!

Link to comment
Share on other sites

I am starting to use this tool and it is a bit overwhelming. :)

What I am trying to do is plan for those contracts where I have to reach a certain orbit, with a defined LAN

Is it possible to plan for that final orbit in a Kerbin-Duna mission so I know the dV requirements in advance?

 

Edit: I found the tutorials :-)

 

Thank you.

Edited by Tacombel
Link to comment
Share on other sites

On 4/2/2019 at 5:52 AM, kurgut said:

Hi @Arrowstar  ,one quick question: does departure/encounter dates calculated by TOT assume to match with KSP SOI leave/enter ?

For departure, I always wonder if it's not the burn date instead of SOI escape; but so far I matched with SOI solution, and it was fine, asking just to be sure:)

thanks!

Strictly speaking, it doesn't really match with either.  However, it's probably more appropriate to say that it's the time of the departure burn when leaving and the time of closest approach when arriving.

On 4/2/2019 at 3:05 PM, Drew Kerman said:

LVD case file

Was going through and checking plots with the GA tool and Dynamic Pressure comes up as 0 across the entire mission time. I'm able to see dynamic pressure graphed okay on other case files so don't know what I did to this one

Thanks, I'll take a look! :)

13 hours ago, Tacombel said:

I am starting to use this tool and it is a bit overwhelming. :)

What I am trying to do is plan for those contracts where I have to reach a certain orbit, with a defined LAN

Is it possible to plan for that final orbit in a Kerbin-Duna mission so I know the dV requirements in advance?

 

Edit: I found the tutorials :-)

 

Thank you.

Sounds good, did you still have a question? :)

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