KSP Trajectory Optimization Tool v0.10
The KSP Trajectory Optimization Tool (KSP TOT) is a piece of MATLAB-based software I've written to help plan and execute interplanetary transfers. It's functions are twofold:
- Using a Lambert solver, generate "porkchop plots" that assist with determining proper departure and arrival times of interplanetary transfer orbits.
- Using the data in (1), determine an optimal hyperbolic departure orbit and compute the burn magnitude and direction (that is, the delta-v vector) as well as the burn location in the initial orbit about the departure planet.
- Compute optimal planetary flybys to cheaply get to those hard-to-reach destinations (Moho, Eeloo, etc).
- Find the optimal two-burn orbit change maneuvers to adjust your orbit cheaply!
All of these functions are essentially working in KSP TOT at the moment. If you're interested in testing an initial release of the code and providing feedback, read on! This thread is a continuation of a related thread
over in the add-on dev forum.
(Please note that KSP TOT is very much in alpha development
and anything about the code base is subject to change without notice. Some functionality may be missing or only partially implemented at this point.)
To install and run KSP TOT, do the following:
- Download the Windows 32-bit 2013a MATLAB Compiler Runtime (MCR).
- Install the MCR package on your computer.
- Download the KSP TOT package.
- Unzip the KSP TOT package to a directory of your choosing.
- Run the KSPTOT application.
- To update from a previous version, just repeat steps 3-5. There is no need to re-download the MCR.
NOTE: I've put together a tutorial on how to use KSP TOT for a basic Kerbin-Duna flight. See this post here for the tutorial.
Have comments or concerns about KSP TOT? I'm looking for feedback! I need people to help me test the application and let me know what works and what needs improvement. Have an idea on how to make the program better? Found a bug? Let me know!
Here are specific points I need feedback on:
1) Thoughts on the user interface. What worked? What doesn't work? What confused you?
2) Accuracy of the departure orbit modeling. Is the computed hyperbolic orbit and burn magnitude/duration/location correct? Using MechJeb to manually type in the NTW components of the burn delta-v is probably the best way to test for now.
3) What other features would you like to see?
Q: Do I really have to enter dates and times in seconds? That sounds awful.
A: Nope! Right click on any time field, select "Enter UT as Date/Time", and fill in the year/day/hour/minute/second in the box that comes up. That's all there is to it!
Q: I'm having problems running KSP TOT. The program doesn't run and just turns into a temp file when I double click it. What is going on?
A: Check to see if your anti-virus software is interfering. Provide an exception for the KSP TOT executable if you need to. Avast has been known to cause problems.
- Added departure information screen.
- Added ability to input time (UT) as a date/time by right-clicking on those text boxes
- Fixed bugs
- Included basic computational options, accessible from Edit->Options,
- Dixed a bug where datatips on the main porkchop plot would not always display estimated delta-v,
- Added a custom display for datatips on the porkchop plot,
- Added time past periapse to the burn information on the departure display GUI.
- Fixed bug where departure calculation window would not refocus after selecting departure/arrival times from porkchop plot.
- In departure calculation input GUI, added ability to right-click on arrival time input and select option to optimize that time based on what's in the departure time box.
- Added application-wide input checking.
- Added ability to optimize departure for given arrival date in Departure Calc window.
- Added ability to find earliest arrival date based on maximum allowable delta-v.
- When generating a porkchop plot, data cursor now appears at the optimal location.
- Apse markers have been added to the transfer orbit display in the departure information window.
- A "global optimum" method has been written and runs after generating a porkchop plot, but it currently doesn't output anything anywhere. I'm still working on what to do with it.
- Added new bodies to the application's database. Corrected existing information where needed.
- Lots and lots of bug fixes.
- Lone Wolfling's "minimize arrival time" with variable departure time optimizer;
- The ability to input arithmetic statements (2+2 for example) into numeric text boxes and have them evaluate (so if you enter 2+2, the box changes to read 4)
- "Optimize Departure for Input Arrival" now uses the input departure time as a lower bound. Useful for when you're in the middle of a game and you clearly can't go back in time to find that "better" solution.
- Some bug fixes and tweaks under the hood.
- A Flyby Maneuver Sequencer(FMS)that is capable of searching for optimal flybys (gravity assist maneuvers) around planets. Spending too much fuel on that trip to Moho? Try a flyby around Eve first!
- Optimal launch/arrival date is now the default setting in the Compute Departure GUI.
- "Time To Periapse" is now shown alongside "Time After Periapse" in the DV Maneuver Information boxes in the Departure Information GUI and the FMS GUI. Useful for using maneuver node editors mostly.
- Some minor visual changes/tweaks to the plots.
- Some bug fixes and a code reoganization on the back-end.
- A two-burn optimal orbit change planner. This allows you to change your current orbit from any one given orbit to another with two engine firings. Very useful for adjusting your inbound hyperbolic orbit to set up that ideal Kethane scanning orbit.
- The ability to port in orbits from SFS files. Right click an orbit panel, hit the appropriate menu item, select the SFS file, and go! Eliminates the need to hand-enter orbits from MechJeb displays or whatnot.
- The addition of the orbital period to some output data.
- The Compute Departure Burn GUI now accepts hyperbolic orbits. (I've left the wording on Elliptical in there for now until I'm satisfied that it works just as well with hyperbolic as well as elliptical orbits.)
- Various minor bug fixes and tweaks.
- Changes to the departure calculation code and the flyby maneuver sequencer in order to better determine burn times and true anomalies when provided with an orbit epoch and mean anomaly at that epoch.
- Right-clicking on the porkchop plot will now bring up a context menu that will allow you to recenter the plot on a particular point on the graph.
- A few minor bug fixes and tweaks.
- New application: Maneuver Execution Assistant. This helps pilots properly time the start of burns to center the delta-v across the maneuver node.
- New application: Rendezvous Maneuver Sequencer. Useful for meeting up with other craft in orbit, as well as moons.
- KSP TOT can now ingest custom celestial bodies files and parse them. Useful for doing stuff in other solar systems you define.
- Added some tooltips to input fields.
- Bug fix: Fixed issue where GUI elements could become distorted and/or shift position
- Bug fix: Fixed issue with code that converts r/v vectors to keplerian elements: now handles 0 eccentricity and inclination much better
- Bug fix: Code now remembers where last opened SFS file was retrieved from.
- Bug fix: Optimization runs now include some scaling of constrains and the objective function.
- Lots of backend changes to support the above.
KSP Trajectory Optimization Tool is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 United States License.