Jump to content

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


Recommended Posts

Hey everyone,

I've compiled KSPTOT v1.6.6 pre-release 10 tonight.  Linux and Windows builds are included in the package. This build includes all of the bug fixes we've been discussing (and that I've mentioned I've completed), as well as:

  • LVD: Initial State steering model variables and throttle model variables will now show up as "initial state" and not "event 0" in various places.
  • MA/LVD: Graphical Analysis now has an altitude independent variable option.
  • LVD: Graphical Analysis can now plot data using event colors.
  • LVD: The generic polynominal steering model had its missing variable class created.
  • LVD: When viewing in "all events" mode, the arrow buttons are now greyed out on the main display.
  • Plus a few other minor optimizations here and there.

If I missed something in the flurry of messages today, please say something so I can address it.  Thanks!

Edited by Arrowstar
Link to comment
Share on other sites

3 hours ago, Arrowstar said:

Actually, just to check, can you provide me with a MAT file that exhibits this problem?  Thanks!

Linked in my post, but perhaps not obvious: https://drive.google.com/drive/folders/1k72IULcWbG381QRC4ag32zPuPLINU2vk

With parallelization, moho2.mat was giving me that first "Finite difference derivatives" error and moho1.mat was generating "Subscript indices" error.

Link to comment
Share on other sites

20 minutes ago, salajander said:

Linked in my post, but perhaps not obvious: https://drive.google.com/drive/folders/1k72IULcWbG381QRC4ag32zPuPLINU2vk

With parallelization, moho2.mat was giving me that first "Finite difference derivatives" error and moho1.mat was generating "Subscript indices" error.

I appear to have resolved the issue shown in the Moho2.mat file.  I haven't been able to reproduce the issue with Moho1.mat yet, but I'll keep poking at it.

Link to comment
Share on other sites

2 hours ago, Entropian said:

Well, I'm back with another question.  Is there a way to calculate which planets to fly by to get to a destination for the lowest delta-V, or will I have to continue entering them manually?

You'll need to use "engineering judgement" to determine that.  Generally the bigger the mass of the body, the better it is for flybys.  So flying by Eve and Jool is good, whereas flyingby Duna and Moho generally isn't.

Link to comment
Share on other sites

Hi everyone,

I want to introduce another new 1.6.6 feature that will be coming in the next (pre-) release.  Up until now, all steering in Launch Vehicle Designer is done with Euler angles defined by time second order polynominals.  This is great for most of the time, but sometimes we know what our attitude is and what we want it to be in the future, but not how to get there.  Enter the "attitude interpolation" steering mode.

WpeirJx.png

You'll notice here that we have the same three Euler angles that are used in the polynomial steering models.  Here, though, we specify the desired initial and final angles, as well as the amount of time to move between them.  Under the hood, the code is using something called quaternion interpolation (via the SLERP algorithm) to compute the attitudes in between the initial and final attitudes.

Notice that all of these quantities can be optimized as needed, and the attitude continuity feature still exists as well.

One great use case for this is when you want to move your spacecraft from one attitude to another attitude but aren't sure how to get it there.  Say your spacecraft finishes a burn and wants to go back to sun-pointing mode to maximize solar panel performance over the course of 5 minutes.  You inherit the burn attitude using the continuity checkbox and then specify the sun pointing attitude you want in the "final value" boxes.  300 seconds goes into the rotation duration box, and you're off to the races.

Here's a simple example of rotating from a Kerbin-pointing attitude to an anti-Kerbin pointing attitude using this new steering mode.

UTK6fAx.gif

What do you all think?

6 minutes ago, Entropian said:

Ok, thanks.  I already know the ins and outs of gravitational assists; I just wanted to check if KSPTOT can test combinations of flybys, e.g. Venus Earth Earth, or Earth Venus Earth, or Earth Earth Venus.

Yeah, it's a good question.  I actually tried to work this problem at one point but as it turns out the combinatorial problem is pretty hard and generally the solutions are pretty well know ahead of time anyway.  (Ex: Going to Eeloo?  Flyby Jool to get there.)

Link to comment
Share on other sites

14 minutes ago, Arrowstar said:

What do you all think?

I think I'm going to spend more time paying attention to whether my radio dish is pointed at Kerbin or not when that doesn't even really matter :P:D

Edited by Drew Kerman
Link to comment
Share on other sites

Aaaand another question. (sorry)  I plotted a multi-flyby maneuver: Earth Venus Jupiter Neptune, and the delta-V was 4.1018 km/s, but when I plotted a Earth Venus Jupiter flyby, the delta-V was 8.19 km/s!?  What is the cause of this?  The transfer window was the same, as well as the starting orbit and transfer time.  The only thing I changed was the destinations.

Link to comment
Share on other sites

@Drew Kerman: Here are your RTGs with half life decay enabled. :)

KogPKRj.png

G4wQXjP.png

You can disable decay by setting the half life to 0.0.

57 minutes ago, Entropian said:

Aaaand another question. (sorry)  I plotted a multi-flyby maneuver: Earth Venus Jupiter Neptune, and the delta-V was 4.1018 km/s, but when I plotted a Earth Venus Jupiter flyby, the delta-V was 8.19 km/s!?  What is the cause of this?  The transfer window was the same, as well as the starting orbit and transfer time.  The only thing I changed was the destinations.

Were you including arrival delta-v in the objective function?  Otherwise, the best explanation is to remember that genetic algorithms, which MFMS uses, are non-deterministic and can find different solutions based on their (randomized) starting conditions.  You might just have to run it a few times.  I seem to recall a feature to automatically run MFMS "x" times for you without human intervention required.

Link to comment
Share on other sites

3 hours ago, Arrowstar said:

Were you including arrival delta-v in the objective function?

No.  I just tried it with it included, and it still yielded the same results...  I ran it 2 times with no luck using the multi-run feature.  Thanks for trying to help though.  I'll just use the Neptune flyby and adjust it ingame.

Edited by Entropian
Link to comment
Share on other sites

Hi everyone,

I compiled the KSPTOT v1.6.6 pre-release 11 tonight.  Windows and Linux builds are included in the ZIP.  Here's the change log:

  • MA/LVD: Fix for mismatched matrix dimension error in SoI search functionality.
  • LVD: New Steering Mode: Attitude Interpolation.  Specify (and/or optimize) your initial and final states and interpolate between them over time.
  • LVD: RTGs can now model radioactive decay according to a half life model that directly impacts power output.
  • LVD: Fixed a few minor bugs with GA and the ODE5 integrator.

We're getting close to the 1.6.6 release, and I think I've wrapped up most or all of the features I wanted to get into this release.  If you're aware of any bugs I haven't addressed yet, please let me know.  Thanks!

Edited by Arrowstar
Link to comment
Share on other sites

9 hours ago, Arrowstar said:

Hi everyone,

I compiled the KSPTOT v1.6.6 pre-release 11 tonight.  Windows and Linux builds are included in the ZIP.  Here's the change log:

  • MA/LVD: Fix for mismatched matrix dimension error in SoI search functionality.
  • LVD: New Steering Mode: Attitude Interpolation.  Specify (and/or optimize) your initial and final states and interpolate between them over time.
  • LVD: RTGs can now model radioactive decay according to a half life model that directly impacts power output.
  • LVD: Fixed a few minor bugs with GA and the ODE5 integrator.

We're getting close to the 1.6.6 release, and I think I've wrapped up most or all of the features I wanted to get into this release.  If you're aware of any bugs I haven't addressed yet, please let me know.  Thanks!

@ArrowstarI'm still getting errors when trying the "Parallelize Script Optimization": "There was an error optimizing the mission script: Subscript indices must either be real positive integers or logicals."

Here is the mission file, if you want to test: https://www.dropbox.com/s/zni6lvtwzzdnihn/Duna Science lab.mat?dl=0

Just enable parallel optimization and start the optimization process.

Edited by vitorboschi
Link to comment
Share on other sites

3 hours ago, vitorboschi said:

@ArrowstarI'm still getting errors when trying the "Parallelize Script Optimization": "There was an error optimizing the mission script: Subscript indices must either be real positive integers or logicals."

Here is the mission file, if you want to test: https://www.dropbox.com/s/zni6lvtwzzdnihn/Duna Science lab.mat?dl=0

Just enable parallel optimization and start the optimization process.

Okay, I see the issue and I think I have it resolved.  I'm going to push out an update for PR11 (same download link as before) today.  When I get it posted I'll let you know and you can let me know if it works for you?

Link to comment
Share on other sites

1 minute ago, Arrowstar said:

Okay, I see the issue and I think I have it resolved.  I'm going to push out an update for PR11 (same download link as before) today.  When I get it posted I'll let you know and you can let me know if it works for you?

Yeah, sure!

Link to comment
Share on other sites

41 minutes ago, Arrowstar said:

Alright, new build is uploading.  Give it 10-15 minutes and then try it out.  The only nontrivial change to this re-release of PR11 is the fix for your error.

@Arrowstar Works great now! Thanks for the quick fix!

Quick question about the info generated by the MFMS: when the Inbound orbit is different from the outbound orbit, even though it's an unpowered flyby, does that mean that there'll be an encounter with one of the moons of that planet? If so, is there any way to see a list of predicted encounters (on MFMS and/or MA)?

For reference, this is what I'm talking about:
 

Quote

Inbound Hyperbolic Flyby Orbit to Jool

---------------------------------------------
Semi-major Axis =               -48429.2622 km
Eccentricity =                  2.464063778
Inclination =                   10.4569 deg
Right Ascension of AN =         37.3961 deg
Argument of Periapse =          240.4379 deg
Periapse Radius =               70903.5286 km
---------------------------------------------
Outbound Hyperbolic Flyby Orbit from Jool
---------------------------------------------
Semi-major Axis =               -42438.8937 km
Eccentricity =                  2.6707
Inclination =                   10.4569 deg
Right Ascension of AN =         37.3961 deg
Argument of Periapse =          240.4379 deg
Periapse Radius =               70903.5286 km
---------------------
Out. Hyp. Vel. Vect Rt. Asc. =  29.9475 deg
Out. Hyp. Vel. Vect Declin. =   -1.3706 deg
Out. Hyp. Vel. Magnitude =      2.580172390 km/s

 

 

Link to comment
Share on other sites

39 minutes ago, vitorboschi said:

Quick question about the info generated by the MFMS: when the Inbound orbit is different from the outbound orbit, even though it's an unpowered flyby, does that mean that there'll be an encounter with one of the moons of that planet? If so, is there any way to see a list of predicted encounters (on MFMS and/or MA)?

No, generally this means that there is a maneuver that is changing the energy of the hyperbolic orbit (and therefore the semi-major axis).  MFMS does not model moon encounters.

Link to comment
Share on other sites

1 minute ago, Arrowstar said:

No, generally this means that there is a maneuver that is changing the energy of the hyperbolic orbit (and therefore the semi-major axis).  MFMS does not model moon encounters.

@ArrowstarIf I understand the report correctly, there's no maneuver predicted (I'm aware that some corrective burns will likely be necessary when running it through MA), so does that mean there's a bug somewhere? Or, more likely, that I'm missing something on the report :rolleyes:

Here's the complete report:

Quote

Hyperbolic Departure & Flyby Orbits
---------------------------------------------
Hyperbolic Departure Orbit from Kerbin
---------------------------------------------
Semi-major Axis =               -277.1564 km
Eccentricity =                  3.882508179
Inclination =                   23.1729 deg
Right Ascension of AN =         250.0648 deg
Argument of Periapse =          356.6385 deg
---------------------
Out. Hyp. Vel. Vect Rt. Asc. =  -7.3871 deg
Out. Hyp. Vel. Vect Declin. =   22.6760 deg
Out. Hyp. Vel. Magnitude =      3.569631040 km/s
---------------------------------------------
Inbound Hyperbolic Flyby Orbit to Jool
---------------------------------------------
Semi-major Axis =               -48429.2622 km
Eccentricity =                  2.464063778
Inclination =                   10.4569 deg
Right Ascension of AN =         37.3961 deg
Argument of Periapse =          240.4379 deg
Periapse Radius =               70903.5286 km
---------------------------------------------
Outbound Hyperbolic Flyby Orbit from Jool
---------------------------------------------
Semi-major Axis =               -42438.8937 km
Eccentricity =                  2.6707
Inclination =                   10.4569 deg
Right Ascension of AN =         37.3961 deg
Argument of Periapse =          240.4379 deg
Periapse Radius =               70903.5286 km
---------------------
Out. Hyp. Vel. Vect Rt. Asc. =  29.9475 deg
Out. Hyp. Vel. Vect Declin. =   -1.3706 deg
Out. Hyp. Vel. Magnitude =      2.580172390 km/s
---------------------------------------------
Inbound Hyperbolic Flyby Orbit to Moho
---------------------------------------------
Semi-major Axis =               -2.7273 km
Eccentricity =                  92.667272592
Inclination =                   100.1756 deg
Right Ascension of AN =         212.6209 deg
Argument of Periapse =          78.7768 deg
Periapse Radius =               250.0001 km
---------------------------------------------
Outbound Hyperbolic Flyby Orbit from Moho
---------------------------------------------
Semi-major Axis =               -2.7273 km
Eccentricity =                  92.6673
Inclination =                   100.1756 deg
Right Ascension of AN =         212.6209 deg
Argument of Periapse =          78.7768 deg
Periapse Radius =               250.0001 km
---------------------
Out. Hyp. Vel. Vect Rt. Asc. =  34.5154 deg
Out. Hyp. Vel. Vect Declin. =   10.4362 deg
Out. Hyp. Vel. Magnitude =      7.862813305 km/s
---------------------------------------------
Inbound Hyperbolic Orbit to Kerbin
---------------------------------------------
Inb. Hyp. Vel. Vect Rt. Asc. =  18.9181 deg
Inb. Hyp. Vel. Vect Declin. =   -1.3922 deg
Inb. Hyp. Vel. Magnitude =      8.6739 km/s

 

Sun-Centric Transfer Orbits
---------------------------------------------
Phase 1 Transfer Orbit (Kerbin -> Jool)
---------------------------------------------
Semi-major Axis =            42791228.3318 km
Eccentricity =                  0.694708132
Inclination =                   6.7026 deg
Right Ascension of AN =         303.7030 deg
Argument of Periapse =          334.6690 deg
Period =                    51367276.6298 sec
Departure True Anomaly =        25.3310 deg
Arrival True Anomaly =          195.4295 deg
Num. Full Revs Prior to Arrival = 0.0000
---------------------------------------------
Phase 2 Transfer Orbit (Jool -> Moho)
---------------------------------------------
Semi-major Axis =            36634561.3085 km
Eccentricity =                  0.842376511
Inclination =                   1.3724 deg
Right Ascension of AN =         350.7865 deg
Argument of Periapse =          306.0179 deg
Period =                    40690301.1678 sec
Departure True Anomaly =        177.0558 deg
Arrival True Anomaly =          324.4466 deg
Num. Full Revs Prior to Arrival = 0.0000
---------------------------------------------
Phase 3 Transfer Orbit (Moho -> Kerbin)
---------------------------------------------
Semi-major Axis =            38294351.6094 km
Eccentricity =                  0.849061098
Inclination =                   1.4668 deg
Right Ascension of AN =         11.9325 deg
Argument of Periapse =          284.6072 deg
Period =                    43486703.9826 sec
Departure True Anomaly =        324.7178 deg
Arrival True Anomaly =          255.3928 deg
Num. Full Revs Prior to Arrival = 0.0000
---------------------------------------------
Kerbin Departure Date =
                Year 3, Day 266 07:59:10.084
                      (85996750.0842 sec UT)
Jool Arrival Date =
                Year 4, Day 289 13:51:14.902
                     (119541074.9023 sec UT)
Moho Arrival Date =
                Year 5, Day 181 22:07:56.892
                     (141775676.8916 sec UT)
Kerbin Arrival Date =
                Year 6, Day 310 00:11:23.749
                     (184378283.7493 sec UT)
---------------------------------------------
Total Mission Duration =
               3 Years, 43 Days 16:12:13.665

 

DV Maneuver Information
---------------------------------------------
Burn Information to Depart Kerbin
---------------------------------------------
Total Delta-V =                 2.8396 km/s
Prograde Delta-V =              2164.0589 m/s
Orbit Normal Delta-V =          1825.6530 m/s
Radial Delta-V =                216.6158 m/s
---------------------
Burn True Anomaly =             250.0648 deg
---------------------------------------------
Burn Information to Depart Jool
---------------------------------------------
Total Delta-V =                 0.0000 km/s
Prograde Delta-V =              0.0000 m/s
Orbit Normal Delta-V =          0.0000 m/s
Radial Delta-V =                -0.0000 m/s
---------------------
Burn True Anomaly =             0.0000 deg
---------------------------------------------
Burn Information to Depart Moho
---------------------------------------------
Total Delta-V =                 0.0000 km/s
Prograde Delta-V =              0.0000 m/s
Orbit Normal Delta-V =          0.0000 m/s
Radial Delta-V =                -0.0000 m/s
---------------------
Burn True Anomaly =             0.0000 deg
---------------------------------------------
Total Mission Delta-V =         2.8396 km/s

 

Link to comment
Share on other sites

34 minutes ago, vitorboschi said:

@ArrowstarIf I understand the report correctly, there's no maneuver predicted (I'm aware that some corrective burns will likely be necessary when running it through MA), so does that mean there's a bug somewhere? Or, more likely, that I'm missing something on the report :rolleyes:

You found a bug. :) I've fixed it and it'll be in the 1.6.6 release.  Thanks!

Edited by Arrowstar
Link to comment
Share on other sites

3 minutes ago, Arrowstar said:

You found a bug. :) I've fixed it and it'll be in the 1.6.6 release.

Awesome! I've been trying to plan that mission on MA for quite a while and never figured out why I couldn't make it work :confused:

Edited by vitorboschi
Link to comment
Share on other sites

Hi everyone!

This afternoon I'm pleased to announce the release of the KSP Trajectory Optimization Tool v1.6.6!  This is a major release that sees some great new features added Launch Vehicle Designer (LVD), as well as bug fixes for Mission Architect (MA), Multi-Flyby Maneuver Sequencer (MFMS), and the Vehicle Sizing Tool (VST).  Of the new features in LVD, the most noteworthy include:

  • A plugin system that allows users to write their own code that is executed during LVD mission script propagation.
  • A new view settings/profile system that allows users to highly customize the way they view trajectories in LVD.  Settings are stored a profiles that make it easy to switch between them quickly.
  • A new ground object system that allows users to define objects which move primarily on or near the surface of celestial bodies, such as ground stations, antennas, vehicles/rovers, and aircraft.  The software automatically computes line of sight to these objects as needed or requested.
  • The ability to compute numerical derivatives and integrals for any quantity in LVD.
  • An electrical power system (EPS) modeling engine that lets users model batteries, solar panels, RTGs, and more onboard a spacecraft, as well as track power consumption, generation, and battery state of charge.

Here's the full change log:

  •     MA: Resolved issue where Ground Targets UI would not open.
  •     LVD: Adjust variables UI is now not modal.
  •     LVD: Graphical analysis now has an "event termination" time indicator line option for plotting.
  •     LVD: Resolved bug when adding a Set Drag Aero Properties action to an event that caused an error to be thrown (and no action to be added to the event).
  •     LVD/MA: Fixed issue with eclipse calculations being wrong;
  •     LVD: Implemented plugin system.
  •     Performance improvement when looking up celestial body data by body ID number.
  •     LVD: Creation of new view settings/profile system that greatly expands what can be viewed and how.
  •     LVD: Addition of two-body rotating frame math under the hood, for use with the state representation code.
  •     LVD: Resolved an issue with the Adjust Variables dialog box that could cause errors to be thrown under certain circumstances.
  •     LVD: Added thrust continuity options to the various thrust profiles.
  •     LVD: Added ground objects, which allow users to model stations and vehicles that primarily exist on or move relative to the surface of a celestial body.
    • The view settings also allow rendering these ground objects in the display window, and ground track and line of sight can also be viewed.
    • Graphical analysis tasks allow you to plot ground object quantities over time.
  •     MA/LVD: Added the ability to change the renderer between OpenGL and Painters.
  •     LVD: New derivative and integral calculations for all quantities.  Can be plotted in Graphical Analysis and used as constraints and objective functions.
  •     All numeric textboxes in KSPTOT now support more complex math functionality, including exponents, square roots, trig functions, and logs.
  •     LVD: Creation of an electrical power system (EPS) modeling engine that helps track power generation, storage, and usage onboard a spacecraft.
  •     LVD: Initial State steering model variables and throttle model variables will now show up as "initial state" and not "event 0" in various places.
  •     MA/LVD: Graphical Analysis now has an altitude independent variable option.
  •     LVD: Graphical Analysis can now plot data using event colors.
  •     MA/LVD: Fix for mismatched matrix dimension error in SoI search functionality.
  •     LVD: New Steering Mode: Attitude Interpolation.  Specify (and/or optimize) your initial and final states and interpolate between them over time.
  •     LVD: Fixed a few minor bugs with GA and the ODE5 integrator.
  •     MFMS: Resolved an issue with wrong powered flyby burn delta-v output being displayed on the user interface.
  •     VST: Added an example file for the Vehicle Sizing Tool.

As usual, the Windows and Linux download links are available in the first post of this thread.  Please let me know if you find any bugs, and I'll work to get them resolved.

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.

pFX1IYV.png

Happy orbiting!

Edited by Arrowstar
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...