Arrowstar

[WIN/MAC] KSP Trajectory Optimization Tool v1.5.9 [New MCR Version!]

Recommended Posts

ok I restarted my PC and the MFMS was taking focus control again so I finally took some time to look into it more and discovered an app that seems to 100% cause the MFMS to steal focus constantly. @Three_Pounds since I know you have the same OS as me would you mind downloading schecklist and running it? Doesn't matter if the MFMS is already open and running or you do that afterwards, both instances I've been unable to keep focus on any other window. It has an Always On Top option that I tried toggling on/off but didn't make a difference. Still I think maybe the way the AOT was coded might be a factor. Strange tho as I had it open before restarting the PC and everything was fine then.

Share this post


Link to post
Share on other sites
On 10/10/2017 at 12:45 AM, Drew Kerman said:

hrm, calculating some porkchop plots In noticed it was only searching for a optimal departure burn 20 times, despite what I had set in the options. Didn't this departure burn search count depend on that option? I honestly can't remember but I thought I had it set once to 50 and that's how many it did for the porkchop plotter. Maybe something got messed up when the update came to allow the MFMS to use this option value as well?

I will look into it!

Share this post


Link to post
Share on other sites
6 hours ago, MedwedianPresident said:

Sorry if this has already been asked or is an idiotic question, but can this somehow be used with RSS?

I was wondering the same thing.

 

Share this post


Link to post
Share on other sites
7 hours ago, MedwedianPresident said:

Sorry if this has already been asked or is an idiotic question, but can this somehow be used with RSS?

 

25 minutes ago, Uace24 said:

I was wondering the same thing.

 

Yes it can. Check the FAQ in the OP for instructions. It is very straight forward. ☺

Share this post


Link to post
Share on other sites

Hi, had another error in the departure burn screen.  When you right click "FInd Earliest arrival for Deltav" and input a deltav number, this error was logged:

Spoiler

Not enough input arguments.

Error in findOptimalDepartureArrivalObjFunc (line 13)


Error in computeDepartureGUI>@(arrivalUT,departUT)findOptimalDepartureArrivalObjFunc(arrivalUT,departUT,departBodyInfo,arrivalBodyInfo,gmu,options.quant2opt)


Error in findEarliestArrivalNonlconFun (line 2)


Error in computeDepartureGUI>@(arrivalUT)findEarliestArrivalNonlconFun(arrivalUT,departUT,dvFunc,maxDV) (line 631)


Error in fmincon (line 621)


Error in fmultistart


Error in MultiStart/run (line 257)


Error in multiStartCommonRun (line 18)


Error in computeDepartureGUI>findEarliestArrivalForDeltaV_Callback (line 639)


Error in gui_mainfcn (line 95)


Error in computeDepartureGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)computeDepartureGUI('findEarliestArrivalForDeltaV_Callback',hObject,eventdata,guidata(hObject))


Caused by:
    Failure in initial user-supplied nonlinear constraint function evaluation. FMINCON cannot continue.
    Failure in evaluation call to the local solver with user-supplied problem structure.

Error while evaluating Menu Callback

Thanks

Edited by Gilph

Share this post


Link to post
Share on other sites
On 10/10/2017 at 12:45 AM, Drew Kerman said:

hrm, calculating some porkchop plots In noticed it was only searching for a optimal departure burn 20 times, despite what I had set in the options. Didn't this departure burn search count depend on that option? I honestly can't remember but I thought I had it set once to 50 and that's how many it did for the porkchop plotter. Maybe something got messed up when the update came to allow the MFMS to use this option value as well?

Okay so I've had a chance to look at it.  That option is only for the Compute Departure calculations and doesn't actually impact the optimal solution calculation on the porkchop plot by design.  It appears to be behaving as it should.

37 minutes ago, Gilph said:

Hi, had another error in the departure burn screen.  When you right click "FInd Earliest arrival for Deltav" and input a deltav number, this error was logged:

  Reveal hidden contents

Not enough input arguments.

Error in findOptimalDepartureArrivalObjFunc (line 13)


Error in computeDepartureGUI>@(arrivalUT,departUT)findOptimalDepartureArrivalObjFunc(arrivalUT,departUT,departBodyInfo,arrivalBodyInfo,gmu,options.quant2opt)


Error in findEarliestArrivalNonlconFun (line 2)


Error in computeDepartureGUI>@(arrivalUT)findEarliestArrivalNonlconFun(arrivalUT,departUT,dvFunc,maxDV) (line 631)


Error in fmincon (line 621)


Error in fmultistart


Error in MultiStart/run (line 257)


Error in multiStartCommonRun (line 18)


Error in computeDepartureGUI>findEarliestArrivalForDeltaV_Callback (line 639)


Error in gui_mainfcn (line 95)


Error in computeDepartureGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)computeDepartureGUI('findEarliestArrivalForDeltaV_Callback',hObject,eventdata,guidata(hObject))


Caused by:
    Failure in initial user-supplied nonlinear constraint function evaluation. FMINCON cannot continue.
    Failure in evaluation call to the local solver with user-supplied problem structure.

Error while evaluating Menu Callback

Thanks

Resolved for next release! (Which might be tonight.) :)

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone,

I've officially updated KSPTOT to version 1.5.8 on the OP.  Improvements for this version are mostly bug fixes provided by users, with the notable exception of a major change to include compatibility with RSS gravitational parameter calculations and multi-revolution support in MFMS.

Please see the OP for the change log; the download link remains the same as always.  Please let me know if you have any questions.  Thanks!

  • Like 3

Share this post


Link to post
Share on other sites

Did you see this? I edited it onto one of my posts on the previous page but I thought it was before you next checked - I never saw a response tho. It's not a major issue

On 10/8/2017 at 4:42 PM, Drew Kerman said:

I noticed that if I have the Mission Animator window open when I try to plot an analysis graph I get an error ding, even though the graph window shows up but without any labels identifying the axis. If it's a multi-plot without sub-plotting then only one window opens with the ding. If I click for a tabular text output the file is not created (wait no yes it is the dialog notification just doesn't show up). Not sure how best to handle this but I think maybe the easiest would be a warning dialog if ppl try to select the graphical analysis tool when the mission animator is open asking them if they'd like to close it & telling them if they don't the GA won't open. Or just fix it so both can be open at the same time? Whatever's easier I'd say.

Also FWIW I didn't notice any immediate issues if I worked things the other way and plotted out two graph windows then opened the mission animator

Share this post


Link to post
Share on other sites

Release looks great so far.

I wanted to ask about optimizing arrival deltav in MA. WHen porkchops are calculated, we have the option of optimizing for arrival deltav, although I don't really know how that is calculated. In MA, it's common to define injection burns after we coast to Pe, but the examples usually just optimize for inclination. If I were to program a capture burn like what is shown on the deltav maps, I could optimize for ecc=.95 or define the SMA or Ap height, but what MA optimization will give be the most optimal injection burn?

Thanks

Share this post


Link to post
Share on other sites

got a new (minor) issue, tested on the latest release. Mission file

  1. Select the final state
  2. Open the Create Coast window and select Go to Function Value
  3. Enter 70 as the Function Value
  4. Save & Close

You'll see MA working to update but it never does. It doesn't freeze though, so you can go up to the Edit menu and undo the coast to return things to normal. Note that the second event is also a Go to Function Value with a value of 70. If you select the last event, right-click and Advance Script Up To Selected Event then repeat the steps above the function value coast will add itself no problem (the point of this mission file was to get only the path of the object through the atmosphere)

Share this post


Link to post
Share on other sites
On 10/14/2017 at 11:17 PM, Drew Kerman said:

Did you see this? I edited it onto one of my posts on the previous page but I thought it was before you next checked - I never saw a response tho. It's not a major issue

Thanks, resolved for next release. 

On 10/15/2017 at 7:28 AM, Gilph said:

Release looks great so far.

I wanted to ask about optimizing arrival deltav in MA. WHen porkchops are calculated, we have the option of optimizing for arrival deltav, although I don't really know how that is calculated. In MA, it's common to define injection burns after we coast to Pe, but the examples usually just optimize for inclination. If I were to program a capture burn like what is shown on the deltav maps, I could optimize for ecc=.95 or define the SMA or Ap height, but what MA optimization will give be the most optimal injection burn?

Thanks

This question is complex because you first have to define what you mean by optimal.  Assuming you mean minimum fuel use, you can use the "maximize spacecraft mass" objective function in mission architect. 

Keep in mind that you have to do some of the legwork too. If ypu want a zero inclination orbit, then either target that on your way in or target an argument of periapsis of 0 or 180 degrees so you can cheaply change inclination at apoapsis.  Or get more creative and use a moon flyby to adjust whatever it is you want. 

Does that answer the question?  I feel like it's a very broad, open ended thing you asked, so if you have particulars, we can talk about those too. 

6 hours ago, Drew Kerman said:

got a new (minor) issue, tested on the latest release. Mission file

  1. Select the final state
  2. Open the Create Coast window and select Go to Function Value
  3. Enter 70 as the Function Value
  4. Save & Close

You'll see MA working to update but it never does. It doesn't freeze though, so you can go up to the Edit menu and undo the coast to return things to normal. Note that the second event is also a Go to Function Value with a value of 70. If you select the last event, right-click and Advance Script Up To Selected Event then repeat the steps above the function value coast will add itself no problem (the point of this mission file was to get only the path of the object through the atmosphere)

Noted, I'll take a look!  Thanks!

  • Like 1

Share this post


Link to post
Share on other sites
34 minutes ago, Arrowstar said:

This question is complex because you first have to define what you mean by optimal.  Assuming you mean minimum fuel use, you can use the "maximize spacecraft mass" objective function in mission architect. 

Keep in mind that you have to do some of the legwork too. If ypu want a zero inclination orbit, then either target that on your way in or target an argument of periapsis of 0 or 180 degrees so you can cheaply change inclination at apoapsis.  Or get more creative and use a moon flyby to adjust whatever it is you want. 

Does that answer the question?  I feel like it's a very broad, open ended thing you asked, so if you have particulars, we can talk about those too. 

Yes, sort of.  I guess I should just ask the very specific question I have.  I fly to an inner planet a lot from my home planet (Gael -> Thalia, similar to Kerbin->Eve).  My capture burns are about twice the optimum listed in the deltav maps (1200 optimum, mine are from 1600-2800). It's my understanding that to minimize that capture burn (the highly elliptical orbit with the Pe close to the planet and the Ap just inside of the SOI), I should arrive at Thalia Pe at close to the same time as the sun centric Pe, which is the point where the relative speeds should have the smallest difference.

So, what kinds of things can I optimize for in MA for departure burns and transfer orbits to arrive in the best orientation? It seems like I want the Thalia Pe at 90 degree angle to prograde, and in the same place as the transfer orbit Pe, so I'm moving almost parallel to Thalia's orbital path. Also, I think the hyperbolic orbit after SOI should be closer to 2-2.5 than 1.

These kind of things are probably similar to reducing the injection burn for Moho and wanted to find out what the smart people do.

Thanks

Share this post


Link to post
Share on other sites
28 minutes ago, Gilph said:

Yes, sort of.  I guess I should just ask the very specific question I have.  I fly to an inner planet a lot from my home planet (Gael -> Thalia, similar to Kerbin->Eve).  My capture burns are about twice the optimum listed in the deltav maps (1200 optimum, mine are from 1600-2800). It's my understanding that to minimize that capture burn (the highly elliptical orbit with the Pe close to the planet and the Ap just inside of the SOI), I should arrive at Thalia Pe at close to the same time as the sun centric Pe, which is the point where the relative speeds should have the smallest difference.

So, what kinds of things can I optimize for in MA for departure burns and transfer orbits to arrive in the best orientation? It seems like I want the Thalia Pe at 90 degree angle to prograde, and in the same place as the transfer orbit Pe, so I'm moving almost parallel to Thalia's orbital path. Also, I think the hyperbolic orbit after SOI should be closer to 2-2.5 than 1.

These kind of things are probably similar to reducing the injection burn for Moho and wanted to find out what the smart people do.

Thanks

If your injection maneuvers are twice the delta-v map values, I would first check to make sure you are not performing an expensive plane change maneuver there. Leaving a planet from the wrong orbital plane (inclination or RAAN) can be very costly. 

If that's not the case, then I'd need to see a mission file to diagnose further. 

  • Like 1

Share this post


Link to post
Share on other sites
17 hours ago, Drew Kerman said:

got a new (minor) issue, tested on the latest release. Mission file

  1. Select the final state
  2. Open the Create Coast window and select Go to Function Value
  3. Enter 70 as the Function Value
  4. Save & Close

You'll see MA working to update but it never does. It doesn't freeze though, so you can go up to the Edit menu and undo the coast to return things to normal. Note that the second event is also a Go to Function Value with a value of 70. If you select the last event, right-click and Advance Script Up To Selected Event then repeat the steps above the function value coast will add itself no problem (the point of this mission file was to get only the path of the object through the atmosphere)

Found the issue!  Resolved for next release.

  • Like 1

Share this post


Link to post
Share on other sites
On ‎10‎/‎16‎/‎2017 at 10:01 AM, Arrowstar said:

If your injection maneuvers are twice the delta-v map values, I would first check to make sure you are not performing an expensive plane change maneuver there. Leaving a planet from the wrong orbital plane (inclination or RAAN) can be very costly. 

If that's not the case, then I'd need to see a mission file to diagnose further. 

I have been playing around with this.  It seems like the regular porkchop/departing burn does the trick nicely and optimizations from MA do not change that significantly. One question I have is when you optimize for arrival deltav in the porkchop/departing calculations, which parameter do you actually minimize?

My next activity is to try and optimize velocity at the target Pe. If I know the velocity at a given Pe at Thalia in a highly elliptical orbit, and I know that my capture burn will be between 1200-2000m/s, then I can put that in MA to optimize. The issue is that there are a lot of velocity parameters to optimize for in MA and not sure which is the best one to use. Will post the results when I get them.

Thanks

 

Share this post


Link to post
Share on other sites
2 minutes ago, Gilph said:

I have been playing around with this.  It seems like the regular porkchop/departing burn does the trick nicely and optimizations from MA do not change that significantly. One question I have is when you optimize for arrival deltav in the porkchop/departing calculations, which parameter do you actually minimize?

It's the inbound hyperbolic excess velocity. 

Let me know how it goes and if I can help or whatnot! 

  • Like 1

Share this post


Link to post
Share on other sites

when does the MFMS determine that a route is not feasible? If one is doing a deep search for departure burns, it could be a decent time-saver to have the MFMS not look for departure burns at all if the route is clipping through planets

Share this post


Link to post
Share on other sites
1 hour ago, Drew Kerman said:

when does the MFMS determine that a route is not feasible? If one is doing a deep search for departure burns, it could be a decent time-saver to have the MFMS not look for departure burns at all if the route is clipping through planets

Technically, when a constraint is violated by the genetic algorithm, that trajectory is infeasible, so the GA knows. But there's no way to determine this a priori.  The code basically needs to try it to see, and just because it's hard to find a solution doesn't mean that it's impossible. ☺

Share this post


Link to post
Share on other sites
On ‎10‎/‎18‎/‎2017 at 9:05 AM, Gilph said:

I have been playing around with this.  It seems like the regular porkchop/departing burn does the trick nicely and optimizations from MA do not change that significantly. One question I have is when you optimize for arrival deltav in the porkchop/departing calculations, which parameter do you actually minimize?

My next activity is to try and optimize velocity at the target Pe. If I know the velocity at a given Pe at Thalia in a highly elliptical orbit, and I know that my capture burn will be between 1200-2000m/s, then I can put that in MA to optimize. The issue is that there are a lot of velocity parameters to optimize for in MA and not sure which is the best one to use. Will post the results when I get them.

Thanks

 

 

On ‎10‎/‎16‎/‎2017 at 10:01 AM, Arrowstar said:

If your injection maneuvers are twice the delta-v map values, I would first check to make sure you are not performing an expensive plane change maneuver there. Leaving a planet from the wrong orbital plane (inclination or RAAN) can be very costly. 

It seems like my optimizing for the Pe at target was not getting me what I wanted, so I started to make the applicable event in MA be the SOI to the target body and setting a few optimizations there. It seems like I was able to get better results for the transfer burns and was getting much closer to the expected results.

I wasn't taking the plane change into account at that time. But, I've done two burns to that planet (Thalia) and each time calculate a transfer burn at about 22 degree inclination, which created about a 5 degree transfer orbit inclination. So my next project is to figure out how best to launch into the proper inclination and RAAN directly. I know there is a estimate launch section in the initial state window and a launch tool to estimate when to lift off. Will have to play around with it.

Thanks.

Share this post


Link to post
Share on other sites
3 hours ago, Arrowstar said:

Technically, when a constraint is violated by the genetic algorithm, that trajectory is infeasible, so the GA knows. But there's no way to determine this a priori.  The code basically needs to try it to see, and just because it's hard to find a solution doesn't mean that it's impossible. ☺

ok, so what I'm saying is once all the GA runs have been completed and all turn up as failures, why should the MFMS then bother to calculate departure burns? I suppose it could remain useful if you wanted to try to tweak things manually in MA?

Share this post


Link to post
Share on other sites

Hello all,

I'm using KSPTOT for a while now and am really amazed by the possibilities which the planner offers. Great work Arrowstar, it's really a perfect addition to KSP for the mission planners, like me.

In my current mission plan I've however encountered an issue with aerobraking that I can't seem to solve myself, and thus I would like to turn to you for help. I am designing a mission plan for a mission to Laythe (as you do), however, this time with heavy use of aerobraking to slow down the spacecraft in both Jools' and Laythes' atmosphere. I'm aware that there are beter ways of decelerating at Jool than through aerobraking, but I'd like to give it a try nonetheless. It's KSP, after all :-)

I've followed the manual, the github wiki page on aerobraking and read the github issue that describes a similar problem (#14). The problem is that, irregardless of mission event setup, it seems that the mission planner and/or optimizer is unable to create a flightpath that leads through Jools atmoshere, as is evident by the error message stating "Cannot execute aerobraking maneuver: Periapse is above the atmosphere". I've tried to force the flight path through the atmosphere by setting a constraint on the periapse altitude, as well as the radius of periapse, but to no avail.

Please see the image below for my current plan.

jLXjezN.png

Can anyone explain to me how to setup the mission planner such, that an aerobraking event is executed? Perhaps there's a series of constraints/events which I'm missing? 

Share this post


Link to post
Share on other sites
15 minutes ago, DaMaster_Architect said:

Hello all,

I'm using KSPTOT for a while now and am really amazed by the possibilities which the planner offers. Great work Arrowstar, it's really a perfect addition to KSP for the mission planners, like me.

In my current mission plan I've however encountered an issue with aerobraking that I can't seem to solve myself, and thus I would like to turn to you for help. I am designing a mission plan for a mission to Laythe (as you do), however, this time with heavy use of aerobraking to slow down the spacecraft in both Jools' and Laythes' atmosphere. I'm aware that there are beter ways of decelerating at Jool than through aerobraking, but I'd like to give it a try nonetheless. It's KSP, after all :-)

I've followed the manual, the github wiki page on aerobraking and read the github issue that describes a similar problem (#14). The problem is that, irregardless of mission event setup, it seems that the mission planner and/or optimizer is unable to create a flightpath that leads through Jools atmoshere, as is evident by the error message stating "Cannot execute aerobraking maneuver: Periapse is above the atmosphere". I've tried to force the flight path through the atmosphere by setting a constraint on the periapse altitude, as well as the radius of periapse, but to no avail.

Please see the image below for my current plan.

jLXjezN.png

Can anyone explain to me how to setup the mission planner such, that an aerobraking event is executed? Perhaps there's a series of constraints/events which I'm missing? 

Can I get a copy of the mission play MAT file?  Just post a link here. Thanks! 

On 10/24/2017 at 11:11 AM, Drew Kerman said:

ok, so what I'm saying is once all the GA runs have been completed and all turn up as failures, why should the MFMS then bother to calculate departure burns? I suppose it could remain useful if you wanted to try to tweak things manually in MA?

Code needs to do that for completion' s sake. Otherwise the UI could break. Yes, I could come up with a solution to this if you'd like, I just never realized it was an issue. ☺

Share this post


Link to post
Share on other sites
4 minutes ago, Arrowstar said:

Can I get a copy of the mission play MAT file?  Just post a link here. Thanks! 

Here you go!

https://1drv.ms/u/s!Ah1BfpUrSEKtgqVngMbmCaicUz7oYg

 

I must also point out that there's no dV manoever while in Jools SoI. Still though, the orbit after the aerobrake is a capture orbit, so it seems that an aerocapture has been performed. Perhaps the logmessage is outdated?

Edited by DaMaster_Architect

Share this post


Link to post
Share on other sites
31 minutes ago, Arrowstar said:

Code needs to do that for completion' s sake. Otherwise the UI could break. Yes, I could come up with a solution to this if you'd like, I just never realized it was an issue. ☺

Naaahhh, not really an issue just idle thinking. Sounds like more trouble than its worth

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now