Jump to content

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


Recommended Posts

I've been working on a new display for Launch Vehicle Designer (LVD).  This is a new ground track display that can show the following on a 2D map of a celestial body.  This display is located on a new tab in the Display area of the main LVD GUI.

  • Vehicle trajectory
  • Ground object location and trajectory
  • Celestial body location and trajectory
  • Terminator line between lit and shadow (day and night) portions of the celestial body
  • Terrain contours (may be turned off and off in View Settings)

Here's a great image of Duna that illustrates these new functionalities. 

WWykiVU.png

You'll also notice that the tool tips on this display are much richer and show more useful data.  This is true for the 3D orbit display as well!

This will show up in the next v1.6.10 pre-release.  Let me know what you think!  Happy orbiting. :)

Link to comment
Share on other sites

  • 2 weeks later...

Can MFMS simulate n-body gravity? I loaded bodies_StockPrincipia.ini and MFMS gave me a maneuver sequence(K-E-E-M). However, when I opened the result file in LVD it violated every constraint. The optimizer didn't help. It just couldn't lower the constraint violation.

btw If MFMS uses stock-like patched conics then how can I get the maneuver sequence?

Link to comment
Share on other sites

5 hours ago, EwTE_H said:

Can MFMS simulate n-body gravity? I loaded bodies_StockPrincipia.ini and MFMS gave me a maneuver sequence(K-E-E-M). However, when I opened the result file in LVD it violated every constraint. The optimizer didn't help. It just couldn't lower the constraint violation.

btw If MFMS uses stock-like patched conics then how can I get the maneuver sequence?

It can, but I'd still highly recommend using LVD.  Did you try scaling the constraints as the text box message that pops up describes?  Can you share your MFMS output with me so I can take a look at it and see what's going on?

In other news, work on the new optional sky box functionality for LVD is progressing nicely.  No more grey axes boxes if you don't want them! :)

CVGYdYp.png

 

Link to comment
Share on other sites

On 1/31/2024 at 9:02 PM, EwTE_H said:

Here   https://livefile.xesimg.com/programme/python_assets/c79165d17bf063d3268aee2d56bfe753.mat

I'm not sure if you can access this website. If you can see the image below, then you can access it.

b3c622711db97b7d5c1ac01df66d17df.png

I have access but when I try to load your MAT file I'm told that it's not a binary MAT file.  Can you try again?

EDIT: Nevermind, seems like it works now.

Edited by Arrowstar
Link to comment
Share on other sites

On 1/31/2024 at 9:02 PM, EwTE_H said:

Here   https://livefile.xesimg.com/programme/python_assets/c79165d17bf063d3268aee2d56bfe753.mat

I'm not sure if you can access this website. If you can see the image below, then you can access it.

b3c622711db97b7d5c1ac01df66d17df.png

You had a couple of issues that I was able to resolve:

1) You had numerical propagation turned on for all your celestial bodies.  That's much slower than the two-body analytic solutions and was causing the propagator to take forever.  I had to change things back to analytic two body propagation.

2) I scaled the constraints by their current value (Optimization menu -> Scale Constraints -> Current Value).

3) I scaled the objective function by 10.

Once I did all of these, the optimizer brought the solution in easier and quickly.  Here's the file.  Please let me know if you have any questions with anything I did!  Happy orbiting! :)

https://drive.google.com/file/d/1t9DxXgP46S7R3gHbPCPeSpExvdcHQHFy/view?usp=sharing

Link to comment
Share on other sites

Thank you but I still have a few questions.

10 hours ago, Arrowstar said:

1) You had numerical propagation turned on for all your celestial bodies.  That's much slower than the two-body analytic solutions and was causing the propagator to take forever.  I had to change things back to analytic two body propagation.

How to turn on numerical propagation only for some celestial bodies? Does it affect accuracy to turn off some or all of that?

10 hours ago, Arrowstar said:

3) I scaled the objective function by 10.

Where does the number 10 come from?

Link to comment
Share on other sites

1 hour ago, EwTE_H said:

Thank you but I still have a few questions.

How to turn on numerical propagation only for some celestial bodies? Does it affect accuracy to turn off some or all of that?

Where does the number 10 come from?

Honestly, just leave the numerical propagation to two body for everything.  Your simulations will run much faster.

You typically want to scale your objective function so that the value is between -1 and 1.  Since final vehicle mass is the objective function, and the final vehicle mass is around 4, a scale factor of 10 is appropriate since it'll make it 0.4, which is between -1 and 1.

Link to comment
Share on other sites

14 hours ago, EwTE_H said:

What do you mean? Should I give up n-body and return to patched conics?

Ah, no, sorry, I think  I see the confusion.  Numerically propagating the orbits of the celestial bodies is NOT the same as using n-body gravity on your spacecraft.  To enable n-body gravity, you need to do the following:

  1. In your initial state, set the bodies you want to use for 3rd body gravity.
  2. For each event, set the Force Model to use 3rd body gravity.

That should be all you need!

Link to comment
Share on other sites

5 hours ago, Arrowstar said:

Numerically propagating the orbits of the celestial bodies is NOT the same as using n-body gravity on your spacecraft. 

So I should use stock-like gravity on celestial bodies and n-body gravity on the spacecraft? If the destination is one of the Joolian moons where n-body gravity on celestial bodies is necessary, what should I do?

Link to comment
Share on other sites

23 hours ago, EwTE_H said:

So I should use stock-like gravity on celestial bodies and n-body gravity on the spacecraft? If the destination is one of the Joolian moons where n-body gravity on celestial bodies is necessary, what should I do?

Correct, that should work just fine! :)

Link to comment
Share on other sites

2 hours ago, Arrowstar said:

Correct, that should work just fine! :)

Mockingbirdnest says that as principia is turned on or off the celestial bodies are likely to move quite a bit. If I use stock gravity, will I find myself going to the place where the celestial body is not here anymore?

Link to comment
Share on other sites

23 hours ago, EwTE_H said:

Mockingbirdnest says that as principia is turned on or off the celestial bodies are likely to move quite a bit. If I use stock gravity, will I find myself going to the place where the celestial body is not here anymore?

Ah, I didn't realize you were using Principia.  In that case, yes, you can turn on the n-body calculations for the celestial bodies as you had it.  Just realize that it's going to be very slow.  Sorry about that.

Link to comment
Share on other sites

I'm running into a problem with the new PR6. After opening the program I can access every module except LVD.

When I select LVD I get the message "Starting Launch Vehicle Designer. Please Wait...". After several seconds there is a brief flash of a window opening and then closing immediately. Then several seconds after that I get a message "An error occured while opening Launch Vehicle Designer."

I downloaded the PR6 file and runtime twice to make sure it wasn't a bad download. I also tried installing on an older notebook that never had this installed just to make sure there wasn't any conflict with previous runtime installs.

The error log is here

========================================
  _  __ _____ _____ _______ ____ _______ 
 | |/ // ____|  __ \__   __/ __ \__   __|
 | ' /| (___ | |__) | | | | |  | | | | 
 |  <  \___ \|  ___/  | | | |  | | | | 
 | . \ ____) | |      | | | |__| | | |  
 |_|\_\_____/|_|      |_|  \____/  |_|  
========================================
KSPTOT v1.6.10 PR6
MATLAB 23.2.0.2485118 (R2023b) Update 6
DATE: 2024/02/11 18:48:15
========================================
Warning: No celestial bodies in the loaded bodies.ini file are using numerical propagation.
> In CelestialBodyIntegration/integrateCelestialBodies
In CelestialBodyData
In projectMain
Unable to resolve the name 'internal.matlab.inspector.PropertyEditedEventData'.

Error in matlab.graphics.internal.propertyinspector.generatePropertyEditingCode (line 7)

Error in matlab.graphics.internal.CameraToolBarManager/setcoordsys (line 870)

Error in cameratoolbar (line 90)

Error in ma_LvdMainGUI_App/ma_LvdMainGUI_OpeningFcn (line 1379)

Error in ma_LvdMainGUI_App>@(app)ma_LvdMainGUI_OpeningFcn(app,varargin{:}) (line 5427)

Error in appdesigner.internal.service.AppManagementService/runStartupFcn (line 135)

Error in matlab.apps.AppBase/runStartupFcn (line 68)

Error in ma_LvdMainGUI_App (line 5427)

Error in newMainGUI_App/LVDButtonPushed (line 306)

Error in appdesigner.internal.service.AppManagementService/executeCallback (line 172)

Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)

Is there a new step in the setup that I missed?

Link to comment
Share on other sites

On 2/11/2024 at 7:07 PM, D_X_Racer_2 said:

I'm running into a problem with the new PR6. After opening the program I can access every module except LVD.

When I select LVD I get the message "Starting Launch Vehicle Designer. Please Wait...". After several seconds there is a brief flash of a window opening and then closing immediately. Then several seconds after that I get a message "An error occured while opening Launch Vehicle Designer."

I downloaded the PR6 file and runtime twice to make sure it wasn't a bad download. I also tried installing on an older notebook that never had this installed just to make sure there wasn't any conflict with previous runtime installs.

The error log is here

========================================
  _  __ _____ _____ _______ ____ _______ 
 | |/ // ____|  __ \__   __/ __ \__   __|
 | ' /| (___ | |__) | | | | |  | | | | 
 |  <  \___ \|  ___/  | | | |  | | | | 
 | . \ ____) | |      | | | |__| | | |  
 |_|\_\_____/|_|      |_|  \____/  |_|  
========================================
KSPTOT v1.6.10 PR6
MATLAB 23.2.0.2485118 (R2023b) Update 6
DATE: 2024/02/11 18:48:15
========================================
Warning: No celestial bodies in the loaded bodies.ini file are using numerical propagation.
> In CelestialBodyIntegration/integrateCelestialBodies
In CelestialBodyData
In projectMain
Unable to resolve the name 'internal.matlab.inspector.PropertyEditedEventData'.

Error in matlab.graphics.internal.propertyinspector.generatePropertyEditingCode (line 7)

Error in matlab.graphics.internal.CameraToolBarManager/setcoordsys (line 870)

Error in cameratoolbar (line 90)

Error in ma_LvdMainGUI_App/ma_LvdMainGUI_OpeningFcn (line 1379)

Error in ma_LvdMainGUI_App>@(app)ma_LvdMainGUI_OpeningFcn(app,varargin{:}) (line 5427)

Error in appdesigner.internal.service.AppManagementService/runStartupFcn (line 135)

Error in matlab.apps.AppBase/runStartupFcn (line 68)

Error in ma_LvdMainGUI_App (line 5427)

Error in newMainGUI_App/LVDButtonPushed (line 306)

Error in appdesigner.internal.service.AppManagementService/executeCallback (line 172)

Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)

Is there a new step in the setup that I missed?

No, this is a new one certainly.  Can't say I've seen this before.  I'm going to push a PR7 out pretty soon (maybe even tomorrow), so can you let me know if the issue persists with the new build?  If it does, I'll investigate further.  Thanks!

Link to comment
Share on other sites

Today I've built KSPTOT v1.6.10 pre-release 7.  This pre-release adds a bunch of new functionality and includes some bug fixes and minor performance improvements, all of which are in LVD.  Here's the change log:

  • Noticeable performance improvement when using numerically propagated celestial bodies.
  • LVD: Added new ground track tab to main LVD UI's display area.
  • LVD: Added sky box code for more "cinematic" display of 3D trajectories.  Set option to enable in View Settings.
  • LVD: Added additional camera controls functionality (Dolly horizontally/vertically camera).
  • LVD: New steering model: tabular quaternion interpolation.
  • LVD: New throttle model: tabular throttle interpolation.
  • LVD: Update version of IPOPT optimizer to v1.1.6.
  • LVD: Add new SQP optimizer algorithm.
  • LVD: Bug fixes and performance improvements.

Please let me know if you find any bugs.  Thanks!  Happy orbiting!

Link to comment
Share on other sites

22 hours ago, Arrowstar said:

No, this is a new one certainly.  Can't say I've seen this before.  I'm going to push a PR7 out pretty soon (maybe even tomorrow), so can you let me know if the issue persists with the new build?  If it does, I'll investigate further.  Thanks!

I tried PR7 tonight and no joy. The situation is the same (all modules except LVD open, when trying to open LVD there is a brief flash of a window opening then closing then error message) except that there is a different error in the log now.

KSPTOT v1.6.10 PR7
MATLAB 23.2.0.2485118 (R2023b) Update 6
DATE: 2024/02/14 19:01:05
========================================
Error using uigridlayout
Unrecognized field name "Value".

Error in ma_LvdMainGUI_App/ma_LvdMainGUI_OpeningFcn (line 1424)

Error in ma_LvdMainGUI_App>@(app)ma_LvdMainGUI_OpeningFcn(app,varargin{:}) (line 5481)

Error in appdesigner.internal.service.AppManagementService/runStartupFcn (line 135)

Error in matlab.apps.AppBase/runStartupFcn (line 68)

Error in ma_LvdMainGUI_App (line 5481)

Error in newMainGUI_App/LVDButtonPushed (line 306)

Error in appdesigner.internal.service.AppManagementService/executeCallback (line 172)

Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)

I'll keep trying different things to see if there is something goofy in the way my setup is configured.

Link to comment
Share on other sites

On 2/14/2024 at 9:19 PM, D_X_Racer_2 said:

I tried PR7 tonight and no joy. The situation is the same (all modules except LVD open, when trying to open LVD there is a brief flash of a window opening then closing then error message) except that there is a different error in the log now.

KSPTOT v1.6.10 PR7
MATLAB 23.2.0.2485118 (R2023b) Update 6
DATE: 2024/02/14 19:01:05
========================================
Error using uigridlayout
Unrecognized field name "Value".

Error in ma_LvdMainGUI_App/ma_LvdMainGUI_OpeningFcn (line 1424)

Error in ma_LvdMainGUI_App>@(app)ma_LvdMainGUI_OpeningFcn(app,varargin{:}) (line 5481)

Error in appdesigner.internal.service.AppManagementService/runStartupFcn (line 135)

Error in matlab.apps.AppBase/runStartupFcn (line 68)

Error in ma_LvdMainGUI_App (line 5481)

Error in newMainGUI_App/LVDButtonPushed (line 306)

Error in appdesigner.internal.service.AppManagementService/executeCallback (line 172)

Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)

I'll keep trying different things to see if there is something goofy in the way my setup is configured.

I've recreated the bug and I believe I've got it figured out.  I reuploaded the PR7 ZIP file.  Please go ahead and redownload that and let me know if you have any issues going forward.  Thanks!

Link to comment
Share on other sites

12 hours ago, Arrowstar said:

I've recreated the bug and I believe I've got it figured out.  I reuploaded the PR7 ZIP file.  Please go ahead and redownload that and let me know if you have any issues going forward.  Thanks!

Success! The revised PR7 now lets me open LVD.

Thanks for taking the time to look into this. It is greatly appreciated.

Link to comment
Share on other sites

  • 3 weeks later...

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