Jump to content

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


Recommended Posts

11 minutes ago, Drew Kerman said:

made it a little further along but I'm borked again. The last event I added hung up the script. I was able to save (should have been saving after each new event, dammit!) but now it won't finish loading. Case file. Also included is the "clean" version from after I setup my rocket and the Close button doesn't work for that vehicle still.

It's those dumb engine states again (you're missing 2, one on the second stage and one on some radial boosters).  I'm not sure if the issue is a hold over from before the last build or if this is something new.  I'll investigate...

Link to comment
Share on other sites

25 minutes ago, Drew Kerman said:

made it a little further along but I'm borked again. The last event I added hung up the script. I was able to save (should have been saving after each new event, dammit!) but now it won't finish loading. Case file. Also included is the "clean" version from after I setup my rocket and the Close button doesn't work for that vehicle still.

Okay, I was able to repair your file. I also added a check that hopefully prevents that from happening again.  I'm guessing this happened on the previous pre-release build, because what I believe caused it was removed in the latest build I posted earlier today.

Let me know if you have any other issues or that file doesn't work for you.

Link to comment
Share on other sites

okay I completed my ascent profile and only found two more issues:

  • Cancelling out of Edit Initial State doesn't work if you edit and save the Initial Aero properties - they remain changed (may affect other properties as well but only confirmed it in this instance)
  • A side effect to my double-click request to check the box for initial vessel setups may be causing this issue, which is that of you double-click on a force model in the list the dialog will close

Also two more questions:

  • What is the normal force?
  • Just need some confirmation on the assumption that all drag modeling automatically stops after 70km and I don't have to explicitly change the drag properties once I'm out of the atmosphere
Link to comment
Share on other sites

9 minutes ago, Drew Kerman said:

okay I completed my ascent profile and only found two more issues:

  • Cancelling out of Edit Initial State doesn't work if you edit and save the Initial Aero properties - they remain changed (may affect other properties as well but only confirmed it in this instance)
  • A side effect to my double-click request to check the box for initial vessel setups may be causing this issue, which is that of you double-click on a force model in the list the dialog will close

Also two more questions:

  • What is the normal force?
  • Just need some confirmation on the assumption that all drag modeling automatically stops after 70km and I don't have to explicitly change the drag properties once I'm out of the atmosphere
  1. So this one isn't so much a bug as it is intentional... when you change the aero properties and then close that dialog, they are changed in the event object in memory immediately.  The "save and close" button the Edit Event menu is (and I realize this is not great design) just for the elements on that UI not behind a button.  I'm sure there's a better way to go about this, I'm just not sure what that is yet.  I won't try to fix it for the 1.6.1 release but maybe I can get that in a 1.6.2 pre-release.
  2. This is actually a "feature" of the a built in "list dialog" of MATLAB, probably not much I can do about that without creating a custom UI for that.  If it's annoying enough, I'll look into it.
  3. Normal force is essentially the ground pushing up on an object to counteract gravity.  It's what keeps you from sinking into the earth.  You can disable it just about every instance unless you're modeling a plane moving down a runway (or any other instance where you need to move along the surface of a body (altitude = 0) relative to that rotating body).
  4. Correct.  In fact, I first do a check and see if density is less than zero, and if it is, I don't even compute the drag force in the normal way, I just return a zero vector for that force element.  So you don't need to change drag properties once you're out of the atmosphere because they're not even checked.
Edited by Arrowstar
Link to comment
Share on other sites

3 minutes ago, Arrowstar said:

probably not much I can do about that without creating a custom UI for that

meh, not a huge issue since you shouldn't be double-clicking there anyways. Was just a chance I came across it

Also, I forgot to request Thrust be added to the Graphical Analysis. that'll help me check that my rocket is moving along as I expect when fiddling around with throttle settings and various throttle ranges for various engines active at the same time

Link to comment
Share on other sites

Just now, Drew Kerman said:

Also, I forgot to request Thrust be added to the Graphical Analysis. that'll help me check that my rocket is moving along as I expect when fiddling around with throttle settings and various throttle ranges for various engines active at the same time

Yes, I can add this.  Good suggestion. :)

Link to comment
Share on other sites

42 minutes ago, Drew Kerman said:

Also, I forgot to request Thrust be added to the Graphical Analysis. that'll help me check that my rocket is moving along as I expect when fiddling around with throttle settings and various throttle ranges for various engines active at the same time

Added for next release.  Enjoy!

zx4Wgv0.png

Link to comment
Share on other sites

gonna dedicate one more day to this. yesterday's ascent profile used a vehicle that flew based on data from a previous launch. Going to use the same vehicle but base the ascent off data from its actual launch and see how well things line up

Link to comment
Share on other sites

alrighty, haven't managed to come across any more major issues.

Have you decided if thrust profiles will be a thing for a future update? I've modeled my launch and I've managed to get timings of events down to within just a few ms but I'm still seeing a large variation in both speed and altitude at the time of the event when comparing the modeled ascent to the actual event. It starts as early as the first boost. Even though I can get the main booster to cut off in the sim at nearly the same millisecond as in the game, the sim has the rocket is traveling higher and faster. Pretty sure it's because I'm hacking in a thrust model for the main booster that uses a thrust curve

Edited by Drew Kerman
Link to comment
Share on other sites

hello, thanks for this program, very usefull

but i want too make flyby mission , i undertstand the flyby sequencer for have a result but after i'm lost for use mission architect  (i 've try too follow the tutorial "systemsolaredge") and i need help....

I think you need or someone who know how use this program too make video tutorial for explain KSPtot

 

Link to comment
Share on other sites

5 hours ago, Drew Kerman said:

oh hey what about a thrust constraint on the optimizer?

Done, it will be in the next release. ;)

4 hours ago, Drew Kerman said:

alrighty, haven't managed to come across any more major issues.

Have you decided if thrust profiles will be a thing for a future update? I've modeled my launch and I've managed to get timings of events down to within just a few ms but I'm still seeing a large variation in both speed and altitude at the time of the event when comparing the modeled ascent to the actual event. It starts as early as the first boost. Even though I can get the main booster to cut off in the sim at nearly the same millisecond as in the game, the sim has the rocket is traveling higher and faster. Pretty sure it's because I'm hacking in a thrust model for the main booster that uses a thrust curve

Good to hear.

I could probably do something like thrust profiles, but I'd need to understand better what you actually want.  Can you sketch out how such a system would work?

3 hours ago, sonic300 said:

hello, thanks for this program, very usefull

but i want too make flyby mission , i undertstand the flyby sequencer for have a result but after i'm lost for use mission architect  (i 've try too follow the tutorial "systemsolaredge") and i need help....

I think you need or someone who know how use this program too make video tutorial for explain KSPtot

 

I'm glad you're enjoying KSPTOT!  While I agree with you that a video tutorial would be great, unfortunately I have no experience at all with creating videos and wouldn't even know where to begin.  If someone else wanted to take up that challenge, I would be happy to support them, of course. 

Keep in mind that Mission Architect and Launch Vehicle Designer, while not quite "professional grade", are certainly approaching that point.  Tools like that are incredibly rewarding to use but do take some time to get your head around.  Keep playing with them, and start simply.  The "flyby" problem in Mission Architect is actually pretty challenging.  I would encourage you to start by simply trying to first model one revolution of a low Kerbin orbit, and then try to change that orbit to a geostationary orbit using two impulsive delta-v maneuvers.  Once you can do that, you should have enough of the basics down to model more challenging missions.

In the mean time, if you can describe a bit more about what you're trying to do and what is not working, I'm happy to help.  Please provide the Mission Architect save file (*.mat format) when you do so I can take a look with you.  Thanks!

EDIT:

Oh, wanted to share something interesting with the community.  Right now KSPTOT is on MATLAB R2017b.  I had an opportunity today to trial R2018b with Launch Vehicle Designer.  This has been on my radar for some time because of supposed improvements to the MATLAB runtime engine that would result in faster execution of code.  Well, The Math Works actually delivered on this one: the asparagus staging example I included a few pre-releases ago executes on R2017b in about 5 seconds.  That same file, using the same code, executes in about 4 seconds on R2018b, resulting in a 20% improvement in code execution speed. 

I'm not saying we're going to R2018b or later any time soon, but it's definitely something I'm going to be thinking about this year because a "free" (as in, no code changes) 20% performance improvement in LVD is nothing to just dismiss outright.  So anyway, stay tuned. :)

Edited by Arrowstar
Link to comment
Share on other sites

Hello!

This evening I am happy to announce the release of KSP Trajectory Optimization Tool v1.6.1.  This is a point release that primarily focuses on improving the new Launch Vehicle Designer (LVD) application within KSPTOT.  LVD is a fully featured mission design tool primarily focused on allowing users to model and optimize launch vehicles.  However, because of the generic way in which LVD is presented, KSP mission analysts can now model full missions, from launch, to in-space maneuvers, to powered landings and parachute descent, all within Launch Vehicle Designer.

Most of the changes in this release are improvements to existing functionality, quality of life enhancements, bug fixes, and LVD script execution performance improvements.  Here's a summary of the change log (generally all referring to LVD):

  • Added a "normal force" model;
  • Added the ability to select the integrator algorithm used for each event;
  • Added new Event Actions to modify drag and lift force properties;
  • Escape key now closes most LVD UIs;
  • Added a dynamic pressure task to Graphical Analysis;
  • Added ability to set the integrator step size for each event;
  • Added "non-sequential events" that can be triggered based on a specified condition in between sequential events;
  • Added a Thrust to Weight throttle model that holds a particular T2W ratio;
  • Added constraints for all existing attitude angles and throttle quantities;
  • Added Graphical Analysis tasks for tank masses, stage dry masses, engine active state, and stage active state;
  • Added "stopwatches" that can be turned on and off during a mission to determine the amount of time between arbitrary events (includes constraints and GA tasks);
  • Added a new LVD example that shows how to model asparagus staging while demonstrating a full trip from Kerbin to the Mun's surface and back to Kerbin;
  • Added ability to selectively turn on and off force models for each event;
  • Greatly sped up the time it takes to perform any action in the UI that could be undone;
  • Added total thrust as a graphical analysis task and constraint;
  • Many, many performance improvements to the LVD script execution engine.  Executing an arbitrary script now takes 25%-50% of the time it did in v1.6.0, on average;
  • Many, many bug fixes!

As usual, the download is available in the first post of this thread.  If you have any questions or discover any bugs, please drop me a line in some fashion to let me know and I'll do my best to address it! This is a really great release that makes LVD more powerful and more enjoyable to use, and I'm hoping you all can start taking advantage of that right away.

Finally, if you enjoy using KSPTOT and its many applications (the Porkchop Plotter, Multi-Flyby Maneuver Sequencer, Mission Architect, Launch Vehicle Designer, and all the rest), please consider buying me a coffee via my Ko-Fi account to support KSPTOT's development.  As I note in the first post of this thread, KSPTOT is a labor of love that I have put many, many hundreds of hours into for the benefit of the KSP community.  The best part of it for me, aside from knowing that KSPTOT is the premier mission design tool for KSP, is all the thank you notes I've received over the years.  I offer this as another way to say "Thank you!", if you so desire. :)

In any event, please let me know if I can help anyone out with using KSPTOT.  Happy orbiting! :)

Link to comment
Share on other sites

2 hours ago, Arrowstar said:

I could probably do something like thrust profiles, but I'd need to understand better what you actually want.  Can you sketch out how such a system would work?

the way it works in the game is to equate thrust with fuel usage. So the curve I'm using for my current SRB is:

      key = 1 0.46
      key = 0.754 0.46
      key = 0 0.1

Basically what it's saying here is that until 75.4% of fuel remains the booster will output at least 46% total thrust and then gradually taper off to 10% thrust as fuel approaches 0. Since this is a curve, (cubic Hermite splines are used, according to this reference) the thrust between 1 and 0.754 actually rises up to nearly 47% thrust and back down, passing through 46% as fuel reaches 75.4% then continuing to taper off.

It's been a stock feature for a while now - no stock engines actually use it, I guess since many newbie players would find it confusing to see their engine thrust vary, but most mods these days do for their SRBs and there are some mods that add the feature to stock SRBs as well

Link to comment
Share on other sites

3 minutes ago, Drew Kerman said:

the way it works in the game is to equate thrust with fuel usage. So the curve I'm using for my current SRB is:

      key = 1 0.46
      key = 0.754 0.46
      key = 0 0.1

Basically what it's saying here is that until 75.4% of fuel remains the booster will output at least 46% total thrust and then gradually taper off to 10% thrust as fuel approaches 0. Since this is a curve, (cubic Hermite splines are used, according to this reference) the thrust between 1 and 0.754 actually rises up to nearly 47% thrust and back down, passing through 46% as fuel reaches 75.4% then continuing to taper off.

It's been a stock feature for a while now - no stock engines actually use it, I guess since many newbie players would find it confusing to see their engine thrust vary, but most mods these days do for their SRBs and there are some mods that add the feature to stock SRBs as well

Okay, thanks.  That is very helpful.  And how does atmospheric density/pressure impact the thrust when you start getting higher up in the atmosphere?

Link to comment
Share on other sites

Just now, Arrowstar said:

And how does atmospheric density/pressure impact the thrust when you start getting higher up in the atmosphere?

You mean how does it impact the thrust percentage defined in the curve? As in, does the curve % equate to the engine's max output (vacuum thrust) or the current thrust being generated

Link to comment
Share on other sites

2 minutes ago, Drew Kerman said:

You mean how does it impact the thrust percentage defined in the curve? As in, does the curve % equate to the engine's max output (vacuum thrust) or the current thrust being generated

Kind of.  I guess I'm wondering if the percentage in the table represents a modifier to the max thrust (and if so, which thrust, SL or vacuum), or to the current throttle of the booster?

Link to comment
Share on other sites

1 hour ago, Arrowstar said:

Kind of.  I guess I'm wondering if the percentage in the table represents a modifier to the max thrust (and if so, which thrust, SL or vacuum), or to the current throttle of the booster?

good question. I did a test:

WngtPmd.png

So on the left you have my thrust curved booster, and on the right you have the same booster without a thrust profile with the thrust limiter set to 46. This is just after ignition in both cases. So the % in the thrust curve key is essentially the throttle

Link to comment
Share on other sites

Just now, Drew Kerman said:

good question. I did a test:

WngtPmd.png

So on the left you have my thrust curved booster, and on the right you have the same booster without a thrust profile with the thrust limiter set to 46. This is just after ignition in both cases. So the % in the thrust curve key is essentially the throttle

Okay!  Thanks for the test, that is useful to know.

So I guess I could use that thrust curve number as a modifier for the current throttle value as it pertains to that engine.  So basically, to compute the effective throttle, determine the actual throttle, incorporating the min and max throttle limits first, and then multiply by the table value.

The last question is the fuel remaining.  Should I find all the tanks that engine is connected to, sum the remaining fuel at the time step, sum the max fuel for those tanks, and then divide the two sums to get the value to look up in the table?  I guess that's probably how KSP works?  Any insight?

Link to comment
Share on other sites

Just now, Drew Kerman said:

sounds right to me. Thrust profiles are generally only meant for SRBs so there wouldn't be any type of fancy tank setups to deal with here

Alrighty then, this probably isn't so bad.  The UI work will be the tricky part, as usual.  I guess it'll be in pre-release 1 of 1.6.2. :)

Link to comment
Share on other sites

Could I get from you, @Drew Kerman, some more test data?  I think I remember you saying you had some plugins that could record data.  Could you take one of your SRBs that you're using with this throttle table thing, fix it to the ground at a set altitude using a launch clamp, and provide me with:

  • Sea level thrust and Isp
  • Vacuum thrust and Isp
  • The fixed altitude of the SRB
  • A table of a tank mass vs. engine thrust all the way from 100% full to 0% (empty)

That would be helpful for me to make sure I'm putting together the model correctly without having to have you double check my work every time I think I have the correct thing.  Thanks!

Link to comment
Share on other sites

can do. Will get around to it sometime today

10 hours ago, Arrowstar said:

throttle table thing

it's called a floatcurve from what I understand. Should be a generic math concept no? I'm sorry for calling you out on this but it does sound a bit like you may be considering this more of a custom-built thing in the game rather than using already-established game and engine features

Link to comment
Share on other sites

1 hour ago, Drew Kerman said:

can do. Will get around to it sometime today

it's called a floatcurve from what I understand. Should be a generic math concept no? I'm sorry for calling you out on this but it does sound a bit like you may be considering this more of a custom-built thing in the game rather than using already-established game and engine features

A float curve is KSP's wrapper for Unity's AnimationCurve and is a list of key, value pairs with optional tangent pairs for shaping the curve.

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