Jump to content

[WIN/MAC/LINUX] KSP Trajectory Optimization Tool v1.6.10 [Major LVD Improvements!]


Recommended Posts

14 hours ago, Drew Kerman said:

also issue with the vessel name import from the SFS is that you have to edit or select the name text field and hit enter for the name to update in the list and be saved

Issue resolved for next release. :)

Link to comment
Share on other sites

Hi everyone,

Tonight I've built KSPTOT v1.6.2 pre-release 4.  This is primarily a bug fix and performance improvement release, and I think we're nearing the v1.6.2 official release.  As with before, this pre-release includes both Windows and Linux builds.  Here's the change log:

  • Added a few more Graphical Analysis tasks to Launch Vehicle Designer (LVD): "Two Body Impact Latitude", "Two Body Impact Longitude", and "Two Body Time to Impact"
    • These provide information on where your spacecraft would impact the current central body under the influence of only two body gravity.  Works well as an initial estimate for stage disposal impact points (because here everyone cares about not dropping stages on populated areas, right?).
  • Fixed bugs reported here since last pre-release.
  • A number of important performance improvements that should be noticeable.

Please let me know if you find any bugs or issues in this release.  Thanks!

Also, could I ask a favor from people using the new pre-releases?  I'm trying to get a feel for what sort of performance everyone is seeing on their systems in LVD.  If you'd like to help, please do the following and report back with results to this thread.  Either Windows or Linux platforms are fine.

  1. Download and run KSPTOT v1.6.2 pre-release 4.
  2. Open Launch Vehicle Designer.
  3. Load the "lvdExample_asparagusStagingToMun.mat" example included with the pre-release package.
  4. After it loads, use the Simulation -> Run Script menu command (or just ctrl-p, it does the same thing) five or six times.  Basically just run the script with no changes five or six times.
  5. Report the lines in the output window that state how long it took the script to execute here in this thread (in a quote or code box).
    1. When you report, please include your CPU model (or number of CPU logical cores and CPU clock rate) and amount of RAM onboard your system. If you know them, of course.

Thank you! :)

Edited by Arrowstar
Link to comment
Share on other sites

perf results:

(11:51:18) Parallel optimization mode enabled.
(11:51:31) Executed mission script in 10.783 seconds.
(11:51:47) Executed mission script in 5.192 seconds.
(11:51:55) Executed mission script in 4.984 seconds.
(11:52:04) Executed mission script in 4.979 seconds.
(11:52:13) Executed mission script in 5.083 seconds.
(11:52:21) Executed mission script in 4.944 seconds.

stdout of the running process reported this:

Starting parallel pool (parpool) using the 'local' profile ...
connected to 8 workers.

Linux host, 16 cores Xeon E5540 @ 2.53GHz each, 24GB RAM. FWIW, I see 8 ctfxlauncher processes spun up but none of them ever consume significant CPU (<1%), while the main KSPTrajectoryOptimizationTool process uses ~160% CPU (so around 1.6 cores) while running the job. Looks like the worker pool is being created but not actually used?

Link to comment
Share on other sites

31 minutes ago, russm said:

Linux host, 16 cores Xeon E5540 @ 2.53GHz each, 24GB RAM. FWIW, I see 8 ctfxlauncher processes spun up but none of them ever consume significant CPU (<1%), while the main KSPTrajectoryOptimizationTool process uses ~160% CPU (so around 1.6 cores) while running the job. Looks like the worker pool is being created but not actually used?

Thanks for the info!  The parallel workers (the ctfxlauncher processes) are only used for optimization, so it makes sense that you only see minimal activity from them when you were just running the script.  If you take that example MAT file I provided and start optimizing it, you should see those eight worker processes begin to do something.

Link to comment
Share on other sites

On 1/10/2019 at 2:12 PM, Arrowstar said:

@CraigCottingham, if you're interested and able, I'd like to tap you to test out the Linux version of KSPTOT, assuming you can?

Sorry; I just now checked in to the forums for the first time in a week. (I expected I'd get a notification of a mention of my username, but apparently not.)

This is exciting news! Commencing download in 3... 2... 1....

Link to comment
Share on other sites

25 minutes ago, CraigCottingham said:

Sorry; I just now checked in to the forums for the first time in a week. (I expected I'd get a notification of a mention of my username, but apparently not.)

This is exciting news! Commencing download in 3... 2... 1....

Thanks!  If you could put together any instructions users would need to get this to run on Mac, that would be great.  And please do use the latest pre-release when you test, the Linux version should be in there. :)

Link to comment
Share on other sites

Results are in for my testing:

Quote

(00:48:53) Loading mission case from "D:\Steam Games\steamapps\common\Kerbal Space           
Program\KSP TOT\lvdExample_asparagusStagingToMun.mat"...Done.                                
(00:49:13) Parallel optimization mode enabled.                                               
(00:49:18) Executed mission script in 5.202 seconds.                                         
(00:50:02) Executed mission script in 2.400 seconds.                                         
(00:50:07) Executed mission script in 2.179 seconds.                                         
(00:50:11) Executed mission script in 2.050 seconds.                                         
(00:50:14) Executed mission script in 2.097 seconds.                                         
(00:50:17) Executed mission script in 2.052 seconds.                                         
(00:50:20) Executed mission script in 2.090 seconds.                                        

Intel Core i7 4790K @ 4.2Ghz (4 cores, 8 threads) 16GB RAM

Link to comment
Share on other sites

10 hours ago, Drew Kerman said:

how'd I not think of this before - could the Line Style dropdown list box be shortened and next to it be a numerical scroll box that lets you set the thickness of the line? Mock up:

Sure, no problem.  I like your mock-up.

@CraigCottingham, any luck with the Linux build of KSPTOT on Mac yet?

Link to comment
Share on other sites

45 minutes ago, Drew Kerman said:

thx. So in addition to this and the other Create State dialogs, there is also the Other Spacecraft dialog in Mission Architect. For the LVD its just the Edit State window

All appropriate UIs updated with "width" field for next release.

Link to comment
Share on other sites

4 hours ago, Arrowstar said:

any luck with the Linux build of KSPTOT on Mac yet?

I've given this a smoke test and it looked OK. Using VirtualBox on macOS 10.14 with Debian 9.6 everything seemed fine (modulo symlinking the runtime to /usr/local/MATLAB/R2017b/).

Do you know if it's OK to distribute VM images with MCR installed? Making appliance Debian live systems is (part of) what I do at work, so for lulz I built a custom KSPTOT livecd and was using that - it comes in at ~1.6GB instead of ~5.5GB for a regular running system including MCR. I'm happy to clean it up and chuck it for distribution somewhere (torrent?) to ease the Linux-ness for macOS users, but I'm unsure if that'd be a problem. I had a quick look over the mathworks site and couldn't see anything about MCR redistribution. This seems like the kind of scenario they may have a distribution exception for, but ¯\_(ツ)_/¯

FWIW, VirtualBox 6.0.2 VM configured w/ 1 CPU 4GB RAM on host w/ 2.9 GHz Intel Core i7

KSP TOT Launch Vehicle Designer v1.6.2 (R2017b)
Written By Arrowstar (C) 2018
#############################################################################################
(02:18:50) Executed mission script in 0.890 seconds.
(02:19:00) Loading mission case from
"/home/user/ksptot/lvdExample_asparagusStagingToMun.mat"...Done.
(02:19:21) Parallel optimization mode enabled.
(02:19:32) Executed mission script in 10.537 seconds.
(02:20:01) Executed mission script in 4.931 seconds.
(02:20:06) Executed mission script in 3.603 seconds.
(02:20:10) Executed mission script in 2.734 seconds.
(02:20:41) Executed mission script in 2.918 seconds.
(02:20:45) Executed mission script in 3.181 seconds.

 

Link to comment
Share on other sites

1 hour ago, russm said:

Do you know if it's OK to distribute VM images with MCR installed? Making appliance Debian live systems is (part of) what I do at work, so for lulz I built a custom KSPTOT livecd and was using that - it comes in at ~1.6GB instead of ~5.5GB for a regular running system including MCR. I'm happy to clean it up and chuck it for distribution somewhere (torrent?) to ease the Linux-ness for macOS users, but I'm unsure if that'd be a problem. I had a quick look over the mathworks site and couldn't see anything about MCR redistribution. This seems like the kind of scenario they may have a distribution exception for, but ¯\_(ツ)_/¯

Thanks for checking this out!  Given that this was the last major thing I wanted looked into before the next release, I think 1.6.2 will officially drop this week at some point.

As far as the MCR goes, it was designed to be distributed with deployed MATLAB software so I doubt there's a problem with that.  However, I do prefer to be in control of the distribution of KSPTOT, so I'd like to continue hosting it myself for the time being.  I also like to keep the MCR package out of the distribution because it is so large, as you've seen.  But thanks for looking into that! It's certainly a novel way to get KSPTOT out there and maybe I'll take you up on it in the future. :)

Link to comment
Share on other sites

7 hours ago, Arrowstar said:

@CraigCottingham, any luck with the Linux build of KSPTOT on Mac yet?

I've been semi-obsessively tinkering with the setup of the virtual machine (it's what I do, unfortunately), but I now have KSPTOT running on Ubuntu 18.04.1 LTS on VirtualBox 6.0.2. Like @russm, I've just done a quick test, but so far it seems to run okay. I've been writing up instructions and will post them here soon, hopefully tomorrow.

Link to comment
Share on other sites

3 hours ago, Arrowstar said:

As far as the MCR goes, it was designed to be distributed with deployed MATLAB software so I doubt there's a problem with that.  However, I do prefer to be in control of the distribution of KSPTOT, so I'd like to continue hosting it myself for the time being.  I also like to keep the MCR package out of the distribution because it is so large, as you've seen.  But thanks for looking into that! It's certainly a novel way to get KSPTOT out there and maybe I'll take you up on it in the future. :)

Ah, yeah, there's no point in baking KSPTOT itself into the livecd that would be *HUGE*. I was thinking of a CD with debian/MCR and a .desktop startup script that unpacks a (separately downloaded) KSPTOT zipfile and sets everything up correctly.

I'll chuck something together to demo and if anybody likes it then so much the better.

Link to comment
Share on other sites

14 hours ago, CraigCottingham said:

I've been semi-obsessively tinkering with the setup of the virtual machine (it's what I do, unfortunately), but I now have KSPTOT running on Ubuntu 18.04.1 LTS on VirtualBox 6.0.2. Like @russm, I've just done a quick test, but so far it seems to run okay. I've been writing up instructions and will post them here soon, hopefully tomorrow.

Sounds good, thanks for looking into it for me!

12 hours ago, CraigCottingham said:

Maybe I missed this in all the previous pages, but is there a way to use KSPTOT to calculate a transfer from (say) an orbit around Kerbin to rendezvous with Mun?

Yes.  For a rough cut that's pretty good, use the Rendezvous Maneuver Sequencer.  It will have drop downs for the orbits of the various planets and moons.  If you want something more high fidelity, use Mission Architect or Launch Vehicle Designer.  Both can handle the analysis you're after with no problems.

Link to comment
Share on other sites

Hey everyone!

This afternoon I have built KSPTOT v1.6.2 pre-release 5.  This is a fairly important build with some nice new features.  As with the previous pre-releases, both Windows and Linux builds are available here.  Here's the change log.  Most items are related to Launch Vehicle Designer unless specified.

  • Added tank flow rate Graphical Analysis task.
  • Added ability to test an event with all available integrators by right-clicking the integrator dropdown menu (in the Edit Event dialog box) and selecting the appropriate menu item.  Shows how long all integrators took to process that event and allows selecting the fastest one immediately.
  • Added line width to all Mission Architect and Launch Vehicle Designer UIs that generate a plotted trajectory.
  • Added Tank to Tank Connections that can flow mass from one tank to another tank, from an external source to a tank (mass creation, like mining), or from a tank to an external sink (mass overboard, like venting propellant).
  • Added back the "Show SoI Transitions" option to LVD's Graphical Analysis tool.
  • Minor performance improvements and bug fixes.

Please let me know if you run into any troubles or bugs, especially with the new tank to tank connections.  Thanks, and happy orbiting!

Edited by Arrowstar
Link to comment
Share on other sites

For any macOS users who don't know/care to do a Linux install for this, I've put together a LiveCD of Debian preconfigured for use under VirtualBox, with MCR pre-installed an a simple launcher for KSPTOT that will unpack one of @Arrowstar's distribution zipfiles (that you download from him and copy in), apply some required fixes to the files in the bundle, and then launch KSPTOT itself. Feel free to try it out and let me know if it works for you. (It should work exactly the same under VirtualBox on Windows, if anyone's feeling masochistic.)

  1. Download ksptot-20190122-092227.iso (bittorrent). This is ~1.6GB, abut the same size as the MCR installer itself.
  2. Create a VirtualBox VM with as much RAM and CPU as you can spare. Don't give it a hard disk. Set ksptot-20190122-092227.iso as the boot CD and check "Live CD/DVD"
  3. *IMPORTANT* For the VM, under Display > Screen > Graphics Controller you must change VMSVGA to VBoxVGA (I expect this to be fixed soon™)
  4. Boot the VM
  5. Under Devices > Drag and Drop, enable at least Host To Guest. Select Bidirectional if you want to save your files persistently
  6. Drag a KSPTOT distribution zipfile in to the VM desktop, it should appear below the KSPTOT icon
  7. Double-click the KSPTOT icon on the desktop (not the zipfile). It will unpack the distribution zipfile, fix what needs fixing, and launch the KSPTOT application
  8. THERE IS NO PERSISTENCE, so to keep your work just save it to the desktop and drag it out before shutting down the VM (I expect this to be fixed soon™)
  9. Every time you launch the VM you'll need to copy in the distribution zipfile, but there's no need to re-download the LiveCD when a new version of KSPTOT is released
  10. If you leave the LiveCD unattended the screenlocker will activate. To unlock the username is "user" and the password is "live"

TODO: fix the vbox guest additions, this should just happen when vbox 6 graduates from Debian's "experimental" distribution in the next couple of weeks. figure out how to make VirtualBox shared folders integrate with the volume manager so saving files out of the VM doesn't require drag-n-drop ugliness. cosmetic polishing.

I expect to finish this for my own use, and am happy to provide it to others for the forseeable future.

 

@Arrowstar a couple of requests: 1. A bunch of the MA windows require a 900px tall screen to not be cropped - can these be squarified a bit so they're usable in less tall VMs? 2. Any chance of getting MA to use parallel workers like LVD when optimising?

Edited by russm
Link to comment
Share on other sites

Hi everyone,

One final feature before the KSPTOT v1.6.2 update drops later this week.  Someone a while back asked me about allowing names to be changed in LVD for the various types of mass you can hold in tanks.  I've implemented that.  See the state readouts in this LVD UI:

rq4gHlU.png?1

You'll notice that the Monoprop and Xenon masses have been replaced with O2 and C02 masses.  You can also have more than three fluid types:

4vCVT2W.png

The first three will show up on the state displays as normal.  Fluid types beyond the first three will get lumped into the dry mass so that the total vehicle mass remains consistent.  (This is for some MA backwards compatibility.)  But here, for example, you could add back monoprop, and "food", and other such resources whose mass change during the mission.  These can then be coupled with the new ability to transfer mass to and from tanks (where it's converted from the old type to the new type of mass) to better simulate a simple life support system.

Thoughts?

 

10 hours ago, russm said:

 

@Arrowstar a couple of requests: 1. A bunch of the MA windows require a 900px tall screen to not be cropped - can these be squarified a bit so they're usable in less tall VMs? 2. Any chance of getting MA to use parallel workers like LVD when optimising?

  1. Possibly.  Which windows are you having trouble with?  What height would they need to be to be usable?
  2. It's already in there actually.  MA Menu bar -> Script -> Execution Settings -> Parallelize Script Optimization :)
Link to comment
Share on other sites

Hey everyone!

This post is only tangentially related to KSPTOT, but is something I wanted to share. 

A number of people have very generously donated to my Ko-Fi account listed in the first post of this thread.  While I don't think I've ever stated as such, I have been mindful of the fact that I would like at least some of those funds to support the future development of KSPTOT.  I consider that to be one of the priority uses of that money.

My current PC is about 6 years old, and this is the machine that I develop KSPTOT on, among other activities.  When I first bought it, I did my best to future proof it as much as possible, and I picked up hardware that has lasted reasonably well.  However, since starting the development of the new Launch Vehicle Designer (LVD) tool, I've been running into situations where my PC has been dangerously short on available memory.  Ever seen your RAM usage get to 98% or 99%?  I did when I started compiling KSPTOT for Linux inside a virtual machine lol.  The major downside of this is that Windows starts using virtual memory on my HDD hard and this really slows the whole system down.  Not surprisingly, it has been clear for some time now that if I wanted to continue productively working on KSPTOT on both Windows and Linux, I was going to have to do something about my RAM problem.

Tonight I've finally solved the issue.  I picked up 16 GB of G.SKILL AEGIS memory and dropped it into my PC tonight.  I can already tell you that it is making a world of a difference.  I can now easily run MATLAB/KSPTOT on both Windows and Linux simultaneously (with room to spare!), which really speeds the process of writing code, debugging it, and building the executables that I push out to you, the KSPTOT community, in the form of releases and pre-releases.  Everything is buttery smooth.

The total amount donated to the Ko-Fi account to date is about $81 (less fees) and the RAM I picked up was about $75 or so.  Basically, everything you guys have given to date has been put towards making the KSPTOT dev experience a bit easier and less of a headache.  Thank you so much for making that possible (it wouldn't have been without you).  It is very, very awesome of all of you and I appreciate it from the bottom of my heart. :)

qT40Fsw.png

Happy orbiting, and thanks for being a great user community!

Link to comment
Share on other sites

14 hours ago, Arrowstar said:

 

On 1/22/2019 at 8:50 PM, russm said:

@Arrowstar a couple of requests: 1. A bunch of the MA windows require a 900px tall screen to not be cropped - can these be squarified a bit so they're usable in less tall VMs? 2. Any chance of getting MA to use parallel workers like LVD when optimising?

  1. Possibly.  Which windows are you having trouble with?  What height would they need to be to be usable?
  2. It's already in there actually.  MA Menu bar -> Script -> Execution Settings -> Parallelize Script Optimization :)

It's the Edit State window for Initial State in particular - at 900px tall (minus window decorations &c) the top label is cropped but it's usable. In a VM, maximised but not fullscreen on a 900px tall display, the Set State Directly/Estimate Launch Trajectory controls are cropped out (https://imgur.com/a/vVKCZhD). At 1280x800 you can't select the departure body, and it gets worse from there on down (though supporting < 800px tall is probably not worth it anyway). I have NFI how the matlab GUI/forms interface stuff works, but if it's pretty much auto-layout in a specified window, can you just double the width of the Edit State popup and it'll reflow the content?

(Edit: I mean reflow to 2 columns, just widening the existing column obvs wouldn't reduce the vertical space)

(Argh, not sure how I missed the Parallelize Script Optimization menu option when I was trying the different optimizers to see if one of them could find my Eve approach. Thanks for the pointer :))

Edited by russm
Link to comment
Share on other sites

On 1/22/2019 at 6:44 PM, russm said:

It's the Edit State window for Initial State in particular - at 900px tall (minus window decorations &c) the top label is cropped but it's usable. In a VM, maximised but not fullscreen on a 900px tall display, the Set State Directly/Estimate Launch Trajectory controls are cropped out (https://imgur.com/a/vVKCZhD). At 1280x800 you can't select the departure body, and it gets worse from there on down (though supporting < 800px tall is probably not worth it anyway). I have NFI how the matlab GUI/forms interface stuff works, but if it's pretty much auto-layout in a specified window, can you just double the width of the Edit State popup and it'll reflow the content?

(Edit: I mean reflow to 2 columns, just widening the existing column obvs wouldn't reduce the vertical space)

A new pre-release build, KSPTOT v1.6.2 pre-release 6, should solve this issue with the Set State UI.  Can you test and see if it works for you on your setup?

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