Jump to content

russm

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by russm

  1. I'd been meaning to ask about this - I've assumed the scale factor is applied to the score on how badly a constraint is failed, so eg. doubling every scale factor in a case changes nothing (or perhaps makes the solver try harder to satisfy all constraints before it cares about optimising1?), and doubling one constraint makes the solver try harder to satisfy that constraint wrt all the others. Is that correct-ish? 1. yeah I get this isn't how the optimiser really works
  2. So with LVD, rather than setting events as "go until $target_state and minimise $thing", it's better to pull the error in state into the objective function and do something like "go until $time and minimise $thing + |$state - $target_state|" and let it figure out what $time works best for that?
  3. Oh, right, that's the bit I was missing. Cheers! For sure, I get this 100% - I live and work in the open source software world where volunteer time and energy is one of the limiting resources for a lot of things. I hope I'm not coming across as "this is bad, you need to do $things to make it good". Any suggestions or requests I make are offered to @Arrowstar in the absolute knowledge that they're to do with as he pleases, and if that's deciding that they're not something he wants to put any effort into then that's absolutely fine and his call to make. And where possible I try to reduce the effort required to implement any request I make, eg once I understood that the problem with duplicating events is that it requires a deep copy of the object graph and Matlab doesn't have a supported way to do that, I found a (possible) workaround. I don't know Matlab so I'm not in a position to evaluate how feasible or desirable that workaround is, so if that makes the feature easy/trivial to implement then that's good, and if @Arrowstar decides he doesn't want to do it for whatever reason then that's absolutely fine too.
  4. Ah, OK so Matlab doesn't provide a deep copy. There appears to be a workaround if you're willing to use undocumented functions. If that doesn't work in this app or you'd rather not colour outside Matlab's lines then give it a miss - doing a deep copy manually is a recipe for the functionality to break in strange ways the next time you extend one of those objects and forget to update the copier.
  5. Hey @Arrowstar, some LVD-n00b questions/suggestions/feature requests: Is it possible to import/export LVD cases to anything other than .mat, or to versions of .mat that other things can read or write? a JSON dump? Octave? (Octave errors out when trying to load an LVD case file .mat, I'm guessing it can't handle some feature used in the ones you're creating) Given the increased detail in LVD, it'd be really nice to be able to eg. import part info for vehicle specification, or copy parts of a flight from one case to another without having to click and type it all in the GUI. It would also solve my other pain points below Is there a way to find which optimisation variables are at/near their limits? The bar chart in the optimiser shows this, but I see no way to easily work out "variable Y is the event duration termination condition for event X". Is it possible to disable the automatic propagation after editing an event? When trying to find variables at their limits having to wait a few seconds after closing one event before being able to open the next is a right pain. Is there (or can there be) a "duplicate event" control? When adding a bunch of identical events like initial pitch profile ones, it'd be nice to not have to click and type through a bunch of GUI windows and make sure they're all done right instead of doing one and then just duplicating a bunch more. But yeah, LVD looks pretty good. Thanks for the cool tool! Edit: OK, scipy.io will happily read those case files, but just gives me a MatlabOpaque and a giant array of uint8 which isn't entirely helpful. I'll have a poke around and see if I can turn this into something I can work with. But if Matlab gives you an easy way to export/import the workspace data as JSON or some other portable structured form instead that'd be nice. (fwiw I wouldn't expect you to support messing around inside case files in any way, but since you don't break them from release to release I'm assuming the internal data is at least stable )
  6. Oh, sweet! Last time I used KSPTOT, LVD was only just starting to get features beyond launch. Guess it's time to learn a new tool Is MA effectively deprecated these days?
  7. presumably the right way to do this is to fix Kerbin departure on the vehicle's phase angle wrt the Mun and then have the optimised variable be the Mun's position in its orbit, but obviously that's not possible to express in MA...
  8. I've picked up KSPTOT (and KSP) again after a while away, and there's a mission plan I'm trying to do but I can't work out how to express it in MA. Any suggestions on how to do this? I'm trying to get MA to plan a Kerbin > Mun powered flybuy > Jool flight. The high-level tools (porkchop &c) give me a general Kerbin > Jool, my current problem is getting the optimiser to then find a good Kerbin departure time - this depends on a shorter timescale on the craft's position around Kerbin to get to the Mun, and on a longer timescale on the Mun's position around Kerbin to usefully help me get to Jool. I'm setting initial Kerbin departure time to the value out of Compute Departure with optimiser boundaries half a month in either direction, to try and find the best time in the Mun's orbit to do the flyby, then initially minimising distance to Jool at Sun apoapsis after a couple of next-soi coasts. But presumably the objective function has *many* local minima (finding the right point in the craft's Kerbin orbit to depart to the Mun and on to Jool throughout the month), but finding the *best* of these minima (where the Mun is optimally placed in its own orbit for this plan) isn't something I've figured out how to do. Is it even possible to get MA to deal with this? In my experimentation so far, I either get garbage plans, or occasionally the MA optimiser spends literal hours at 100% CPU without completing even a single optimisation step - I sorta assume it's just jumping between local minima and getting super confused that the objective function makes no sense at all.
  9. ah sorry, yes I had to update it with a filename that macOS would be happy with. I've updated the link in the original post, also here or magnet link (can't figure out how to make the forum accept it as clickable, should all be one item with no line-breaks): magnet:?xt=urn:btih:87b1012c30126330430d962f230531117fc8c40f&dn=KSPTOT%20LiveCD&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Fopentor.org%3A2710&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.blackunicorn.xyz%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969
  10. The run script needs to be given the path to the Matlab/MCR install, and won't be in the user's PATH either. I'd phrase it like this: From within the directory where you unpacked KSPTOT, run "./run_KSPTrajectoryOptimizationTool.sh /usr/local/MATLAB/R2017b/" to launch KSPTOT. Otherwise those instructions look good to me.
  11. Nope, those should do it. For the install location/symlink thing, if you install MCR to the default location, this will create the required link: sudo ln -s ./MATLAB_Runtime/v93/ /usr/local/MATLAB/R2017b
  12. Possibly. Which windows are you having trouble with? What height would they need to be to be usable? 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 )
  13. 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.) Download ksptot-20190122-092227.iso (bittorrent). This is ~1.6GB, abut the same size as the MCR installer itself. 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" *IMPORTANT* For the VM, under Display > Screen > Graphics Controller you must change VMSVGA to VBoxVGA (I expect this to be fixed soon™) Boot the VM Under Devices > Drag and Drop, enable at least Host To Guest. Select Bidirectional if you want to save your files persistently Drag a KSPTOT distribution zipfile in to the VM desktop, it should appear below the KSPTOT icon 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 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™) 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 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?
  14. 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.
  15. 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.
  16. 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?
  17. FWIW the packaged Linux executables don't have their execution bit correctly set - after unzipping you'll need to run chmod +x run_KSPTrajectoryOptimizationTool.sh KSPTrajectoryOptimizationTool to fix that (this only needs to be done once after unzipping), and then launch KSPTOT from within the extracted directory like so: ./run_KSPTrajectoryOptimizationTool.sh /usr/local/MATLAB/R2017b/
  18. MA Bug: selecting Optimization > Re-optimize Mission fails ("There was an error optimizing the mission script: Index exceeds array dimensions") Is re-optimize meant to do anything different to just re-running the solver with the last-used settings?
  19. Can I get some MA advice? I'm trying to do a Kerbin-Eve-Eve-Jool flight, and I can't get my desired first Eve approach. I'm following the basic script of the Solar System's Edge tutorial. I hit Eve's SoI, added constraints for UT and the plane of the Eve inbound hyperbolic trajectory, and got those correct. But when I add constraints for Eccentricity and either SMA or Periapse Radius the solver can't get those final parameters right. I've also tried locking all the departure variables and adding a deep space maneuver at various points on the Kerbin to Eve coast, and it still can't seem to find a way to get the SMA and eccentricity right - they don't get closer than several %. Based on the constraint ranges in the tutorial I'm assuming this isn't near close enough. My current .mat file and the MFMS info I'm trying to follow are at https://ufile.io/w4bo3 Thanks!
  20. The simplest is "You *must* install MCR to the path /usr/local/MATLAB/R2017b/ for KSPTOT to work. Once MCR is installed in the correct location you should have a file /usr/local/MATLAB/R2017b/MCR_license.txt present on your Linux system." Yeah it's clearly a MATLAB issue. I just pointed it out for lulz, not with any expectation you could do anything about it. And now a couple of questions: * When departing a planet I think I understand the reason for splitting the long coast into a "to next SoI" and a "to body periapsis", but it makes me (probably pointlessly) nervous about triggering on an inferior SoI instead of the superior one. Is there any downside (significant calculation cost?) to instead using Coast > to Function Value > Central Body ID to ensure that segment only ever triggers when expected? * Is it viable to add a "minimise delta-v" optimisation target? If my initial parking orbit isn't great but I find an ejection burn with significant normal/radial components, it'd be nice to be able to constrain on arrival bodyID/UT and then go back to optimise the parking orbit elements with a target of minimising delta-v. Is this a dumb approach?
  21. Just wondering, is there any reason (other than "historical reasons") for the distinction between constraints and the optimisation objective function? Is there a way to change the weighting of different constraints for the constraint violation metric?
  22. Cool, I assumed it was in there somewhere but hadn't found it The problem isn't a missing file in the bundled app, but rather for *one* of the built executable objects (helper_methods/math/mtimesx/mtimesx.mexa64) it's looking for the BLAS library where it's installed on your build host and only in that location, rather than using the system tools for finding libraries (which would find the MCR version wherever that's installed). If you can't see a way to chage/fix that the simple workaround for end users is to either a) install MCR to the specific path "/usr/local/MATLAB/R2017b", or b) put a symlink at "/usr/local/MATLAB/R2017b" that points to wherever MCR is installed. I've done b) and everything seems to be working fine. I hate to recommend doing it that way since it's an ugly workaround rather than an actual solution, but it's certainly good enough so *shrug* I guess it'll do. As an aside, it looks like Matlab under linux doesn't play well with HiDPI displays
  23. @Arrowstar still not quite right with the porkchop plotter, but at least it's more verbose now: ------------------------------------------ Setting up environment variables --- LD_LIBRARY_PATH is .:/opt/MATLAB/MATLAB_Runtime/v93//runtime/glnxa64:/opt/MATLAB/MATLAB_Runtime/v93//bin/glnxa64:/opt/MATLAB/MATLAB_Runtime/v93//sys/os/glnxa64:/opt/MATLAB/MATLAB_Runtime/v93//sys/opengl/lib/glnxa64 Invalid MEX-file '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64': Missing dependent shared libraries: '/usr/local/MATLAB/R2017b/bin/glnxa64/libmwblas.so' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' 'libm.so.6' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' 'libc.so.6' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'clock' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol '__ctype_toupper_loc' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'daxpy_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'ddot_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'dgemm_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'dgemv_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'dger_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'dsyr2k_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'dsyrk_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'memcpy' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'saxpy_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'sdot_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'sgemm_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'sgemv_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'sger_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'sin' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'sqrt' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'ssyr2k_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'ssyrk_' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol '__stack_chk_fail' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'strcmp' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64' Missing symbol 'sysconf' required by '/home/russm/.mcrCache9.3/KSPTra0/helper_methods/math/mtimesx/mtimesx.mexa64'. Error in lambert_vector (line 36) Error in computePorkChopData (line 78) Error in generatePorkChopPlot (line 28) Error in mainGUI>testPorkChopper_Callback (line 376) Error in gui_mainfcn (line 95) Error in mainGUI (line 42) Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)mainGUI('testPorkChopper_Callback',hObject,eventdata,guidata(hObject)) Error using waitforallfiguresclosed (line 9) Error while evaluating UIControl Callback. The "Invalid MEX-file" line and following appear when I click "Compute Porkchop Plot". Looks like something's expecting your build environment at /usr/local/MATLAB/R2017b/ instead of the portable MCR environment. If I put symlinks under /usr/local/MATLAB to fake it out then the porkchop plotter works fine, but if there's an obvious fix in the build settings that'd be nice. Many thanks for this!
  24. OK re-downloading now. One other question (where I'm perhaps missing something obvious) - is there any way to import current vehicle state from KSP to MA? I see pushing maneuvers back through KSPTOTConnect, but no way to set the initial MA state (other than hand-transcribing).
×
×
  • Create New...