Jump to content

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


Recommended Posts

2 hours ago, Drew Kerman said:

Ah, so here is the root of the problem then? I guess I am actually changing Kerbin's synodic rotation rate. Here's the patch I use:


  @Body[Kerbin]
  {
    @Properties
    {
      // return Kerbin to old pre-v1.0.5 rotation period
      %rotationPeriod = 21651
    }
  }

I know Kopernicus is working because the new default is 6hrs to match sidereal rotation and the sun will stay in one place if I forward time. Using Hyperedit I can increment the game UT on a week/day/hour basis and clicking repeatedly on the Day+ button the date increases but the sun position does not change after disabling this patch. When I restart the game with my patch again enabled, clicking the Day+ button makes the sun move across the sky. As I noted in my original post, I made this change so sunrise/sunset times would change from day to day.

My understanding of sidereal vs. synodic time however is still not that great in application so maybe I'm just barking up the wrong tree on this issue?

The basic difference is that sidereal day length is the amount of time the planet takes to rotate 360 degrees.  The synodic day is the length of time required to rotate from noon to noon (so overhead sun to overhead sun).  These are different because the planet must rotate MORE (> 360 deg) to get back to noon because it is also moving around the Sun.

Sidereal rotation period is what I need for computing the angular rotation rate of the celestial bodies, so that's what's in KSPTOT.

I'm not sure if that helps any?

26 minutes ago, vitorboschi said:

@ArrowstarThanks for the info about orbit epoch! That worked out!

 

Now, I think I stumbled upon a bug:


Matrix dimensions must agree.

Error in TwoBodyPropagator/propagate (line 72)


Error in LaunchVehicleSimulationDriver/integrateOneEvent (line 171)


Error in LaunchVehicleEvent/executeEvent (line 162)


Error in LaunchVehicleScript/executeScript (line 293)


Error in ma_LvdMainGUI>propagateScript (line 180)


Error in ma_LvdMainGUI>runScriptMenu_Callback (line 1635)


Error in gui_mainfcn (line 95)


Error in ma_LvdMainGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)ma_LvdMainGUI('runScriptMenu_Callback',hObject,eventdata,guidata(hObject))

Error using waitforallfiguresclosed (line 9)
Error while evaluating Menu Callback.

This happen when opening my LVD mission. Could you take a look at the .mat? Here's the link: https://www.dropbox.com/s/zc2cbiqzt9xn8am/lvd-moho-mission.mat?dl=0

Yes, you found a bug.  Resolved for next release.

I'm also happy to share that the main LVD window will now be resizable.  It was a ton of work to pull this off because I had to compute the new dimensions manually, but hopefully this is a nice addition.  Don't expect it for other UIs any time soon though lol.

Link to comment
Share on other sites

On 12/15/2020 at 4:28 PM, Drew Kerman said:

@Arrowstar I can't use the included bodies.ini file because I have Kopernicus messing with Kerbin's atmosphere and spin rate. I tried to generate a new .ini but the texture feature was not included in the file. I placed the Kerbin texture lines in myself and that works but was not able to adjust the rotational offset. I tried using surfTextureZRotOffset but not sure if that's what that is for as it didn't seem to make any difference. I made sure to not only reload the .ini file after editing but also never saved my LVD file after load which means it would again convert it to the new .ini data. Here is the discrepancy:

LVD:
CbqZxc2.png

Where the trajectory is supposed to end, plugging the lat/lng into my online map
swCQnBM.png

Ahhh, I was just about to post this and had another thought. Did some experimenting and yup, I see what's happening now. The surfTextureZRotOffset is working as intended, each time I edit it and load up LVD the default view of Kerbin changes as the texture is rotated. I didn't really pay attention before just loaded straight up into my case file. So okay the conversion is not using the currently-loaded .ini file it's converting based on the .ini data already in the case file. So then you're either a bit off on the offset calculation to account for a different body rotation speed or forgot to account for that altogether during the update.

@Arrowstar I noticed that you exported all your images with "oceanFloor = true", I would suggest you to try with "false" because I have the feeling it would give a better result for this specific use

Link to comment
Share on other sites

1 hour ago, Sigma88 said:

@Arrowstar I noticed that you exported all your images with "oceanFloor = true", I would suggest you to try with "false" because I have the feeling it would give a better result for this specific use

Agreed, I actual have rerendered stuff since then to take out the ocean floors.  Thanks for pointing it out! :)

Edited by Arrowstar
Link to comment
Share on other sites

53 minutes ago, Drew Kerman said:

yes that helps, thank you. I'm going to try and recreate this on the next PR and see what happens

Well great timing!  Thanks for the segue. ;)

Today I've built KSPTOT v1.6.7 pre-release 9.  Here's the change log:

  • LVD: Steering model UIs now display proper angle names and not just "alpha", "beta", and "gamma."
  • LVD: The main LVD window is now resizable.  There is a minimum size limit equal to the current window size, but no limit on the maximum.
  • Resolved TwoBodyPropagator error.
  • The ocean floor has been removed from the Eve and Kerbin surface textures.
  • The issue with radio button strings overrunning their bounds in the main KSPTOT UI on Linux has been resolved.
  • LVD: Added a new toolbar button to toggle the camera toolbar on and off.  The camera toolbar can be used to move the physical scene camera around, which often makes for a better viewing experience.  The current zoom and pan buttons actually adjust the scene axis limits directly, which can be non-ideal in many cases.

Please let me know if you find any bugs, thanks!

Link to comment
Share on other sites

1 hour ago, Arrowstar said:

Well great timing!  Thanks for the segue. ;)

Today I've built KSPTOT v1.6.7 pre-release 9.  Here's the change log:

  • LVD: Steering model UIs now display proper angle names and not just "alpha", "beta", and "gamma."
  • LVD: The main LVD window is now resizable.  There is a minimum size limit equal to the current window size, but no limit on the maximum.
  • Resolved TwoBodyPropagator error.
  • The ocean floor has been removed from the Eve and Kerbin surface textures.
  • The issue with radio button strings overrunning their bounds in the main KSPTOT UI on Linux has been resolved.
  • LVD: Added a new toolbar button to toggle the camera toolbar on and off.  The camera toolbar can be used to move the physical scene camera around, which often makes for a better viewing experience.  The current zoom and pan buttons actually adjust the scene axis limits directly, which can be non-ideal in many cases.

Please let me know if you find any bugs, thanks!

Another bug:
 

Starting parallel pool (parpool) using the 'local' profile ...
connected to 4 workers.
Subscripted assignment dimension mismatch.

Error in TwoBodyPropagator/propagate (line 62)


Error in LaunchVehicleSimulationDriver/integrateOneEvent (line 171)


Error in LaunchVehicleSimulationDriver/processIntegratorTerminationCauses (line 209)


Error in LaunchVehicleSimulationDriver/integrateOneEvent (line 182)


Error in LaunchVehicleSimulationDriver/processIntegratorTerminationCauses (line 209)


Error in LaunchVehicleSimulationDriver/integrateOneEvent (line 182)


Error in LaunchVehicleEvent/executeEvent (line 162)


Error in LaunchVehicleScript/executeScript (line 293)


Error in ma_LvdMainGUI>propagateScript (line 255)


Error in ma_LvdMainGUI>openMissionPlanMenu_Callback (line 953)


Error in gui_mainfcn (line 95)


Error in ma_LvdMainGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)ma_LvdMainGUI('openMissionPlanMenu_Callback',hObject,eventdata,guidata(hObject))

Error using waitforallfiguresclosed (line 9)
Error while evaluating Menu Callback.

Just opening the following .mat on LVD should trigger the issue: https://www.dropbox.com/s/ufq3pg3wh57v8vg/lvd-moho-mission.mat?dl=0

 

Link to comment
Share on other sites

8 minutes ago, vitorboschi said:

Another bug:
 


Starting parallel pool (parpool) using the 'local' profile ...
connected to 4 workers.
Subscripted assignment dimension mismatch.

Error in TwoBodyPropagator/propagate (line 62)


Error in LaunchVehicleSimulationDriver/integrateOneEvent (line 171)


Error in LaunchVehicleSimulationDriver/processIntegratorTerminationCauses (line 209)


Error in LaunchVehicleSimulationDriver/integrateOneEvent (line 182)


Error in LaunchVehicleSimulationDriver/processIntegratorTerminationCauses (line 209)


Error in LaunchVehicleSimulationDriver/integrateOneEvent (line 182)


Error in LaunchVehicleEvent/executeEvent (line 162)


Error in LaunchVehicleScript/executeScript (line 293)


Error in ma_LvdMainGUI>propagateScript (line 255)


Error in ma_LvdMainGUI>openMissionPlanMenu_Callback (line 953)


Error in gui_mainfcn (line 95)


Error in ma_LvdMainGUI (line 42)


Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)ma_LvdMainGUI('openMissionPlanMenu_Callback',hObject,eventdata,guidata(hObject))

Error using waitforallfiguresclosed (line 9)
Error while evaluating Menu Callback.

Just opening the following .mat on LVD should trigger the issue: https://www.dropbox.com/s/ufq3pg3wh57v8vg/lvd-moho-mission.mat?dl=0

 

Are you sure you're on the latest PR?  I couldn't reproduce it over here and it looks like it's the same issue you reported previously which I fixed.

Link to comment
Share on other sites

13 minutes ago, Arrowstar said:

Are you sure you're on the latest PR?  I couldn't reproduce it over here and it looks like it's the same issue you reported previously which I fixed.

Yeah, I've just checked here (also checked that it happens every time here). The previous bug was gone, indeed. Did you re-downloaded the .mat? I have updated it since the previous issue.

Link to comment
Share on other sites

11 minutes ago, vitorboschi said:

Yeah, I've just checked here (also checked that it happens every time here). The previous bug was gone, indeed. Did you re-downloaded the .mat? I have updated it since the previous issue.

Yes, I pulled the  MAT file from the link in your last post there.  It loads fine for me.  Does it not for you?

Link to comment
Share on other sites

2 minutes ago, Arrowstar said:

Yes, I pulled the  MAT file from the link in your last post there.  It loads fine for me.  Does it not for you?

The file loads, but as it tries to (automatically) propagate the script, it pops that error. Is there anything I can do to help you pinpoint the problem?

Link to comment
Share on other sites

6 minutes ago, vitorboschi said:

The file loads, but as it tries to (automatically) propagate the script, it pops that error. Is there anything I can do to help you pinpoint the problem?

I'm not sure.  I can't reproduce any propagation error on either Windows or Linux.  Can you try to duplicate the error in a clean MAT file?  And double check you're seeing "v1.6.7 PR9" in LVD's output area, of course.

Link to comment
Share on other sites

3 hours ago, Arrowstar said:

Well great timing!  Thanks for the segue. ;)

Yep, I felt there was one dropping soon

Also, I am a FRIKIN IDIOT HAHAHAHAHAHAHA

I figured out what the problem was.

Guess what happens when you move the time slider to the end where the vessel is supposed to be at that time?

*sigh* ;)

This does present an interesting question for Mission Architect though, where I'm not sure the planet textures serve any real purpose because at what point does the surface texture relate to the orbit given that you can't actually see the vessel's position? It's useful in LVD and Mission Animator, but for the default Mission Architect view you're just as good with the original shaded bodies. However if there's no performance impact to having them textured then I also see no harm in the textures being used

Link to comment
Share on other sites

12 minutes ago, Drew Kerman said:

Also, I am a FRIKIN IDIOT HAHAHAHAHAHAHA

I figured out what the problem was.

Guess what happens when you move the time slider to the end where the vessel is supposed to be at that time?

*sigh* ;)

Hahaha, oh no lol.  I'm glad everything is working as expected now. :)

Quote

This does present an interesting question for Mission Architect though, where I'm not sure the planet textures serve any real purpose because at what point does the surface texture relate to the orbit given that you can't actually see the vessel's position? It's useful in LVD and Mission Animator, but for the default Mission Architect view you're just as good with the original shaded bodies. However if there's no performance impact to having them textured then I also see no harm in the textures being used

The impact of texuturing the spheres is pretty minimal after you load the texture the first time, and even that's small. I'm not worried about it.

Link to comment
Share on other sites

3 hours ago, Arrowstar said:

LVD: Added a new toolbar button to toggle the camera toolbar on and off.  The camera toolbar can be used to move the physical scene camera around, which often makes for a better viewing experience.  The current zoom and pan buttons actually adjust the scene axis limits directly, which can be non-ideal in many cases.

this is really cool. Is it possible to use also in the pop out figure window? Although if not, at least the LVD window can be resized now to make the figure almost as big

Link to comment
Share on other sites

3 minutes ago, Drew Kerman said:

this is really cool. Is it possible to use also in the pop out figure window? Although if not, at least the LVD window can be resized now to make the figure almost as big

Sure.  I'll set it up so that if the camera toolbar is visible on the main UI, then it will be visible on the pop out display as well.

Link to comment
Share on other sites

Just now, Arrowstar said:

Sure.  I'll set it up so that if the camera toolbar is visible on the main UI, then it will be visible on the pop out display as well.

nice.

Also here's some "IRL" results for you! De-orbited my Kerbin II satellite today:

VZ6CetV.png

End of plot is where the chutes were calculated to deploy at 1.2km and the red spot is where the satellite actually splashed down. Not too shabby!! In fact, the discrepancy is most likely due to the chutes pre-deploying at ~30km and this extra drag is not factored in, which is why the LVD plot goes a bit further. I did a "simulation" where I just Hyperedited the satellite to 80km and had it drop straight down while logging in FAR to get a rough Cd curve. Imported that then I used my drag area technique from the wiki, plugged in the re-entry trajectory orbital deets from MA where I calculated the maneuver - and viola!

Well, almost. I did screw up and forget to unload the propellant from the default spacecraft tank in LVD, so I originally got the result I showed in my earlier posts. Ooof I know you guys have procedures to avoid simple mistakes like this and I still have to work on mine!!

Link to comment
Share on other sites

Is there any more documentation on the LVD anywhere? I just can't seem to get started with it. The tutorial isn't much help, because it starts from a rocket launch, and at this point I build all me vessels in LKO. When I try to import the orbit data for a craft, it just... doesn't? I feel like there's an option somewhere I'm not setting, but I don't know what it is, hence asking about documentation. This is the problem:

I select the craft I want to import data from:

2t1ikUR.png

And then after I hit 'Use Selected Orbit', the values copied across are wildly different:

TWmReMW.png

What's going on here?

 

Changing topics, as I look around inside the LVD, I'm really excited about what it looks like it can do (Once I get past step 1), and the new textures are awesome!

Edited by Snoman314
Link to comment
Share on other sites

OK, now I'm having problems I haven't seen before with the Mission Architect. I'm trying to set a coast to ascending node to zero out inclination, and I'm getting error messages. The scenario below highlights the issue. The green line is set to coast to the _Ascending_ node. 

 

G97NQwZ.png

Link to comment
Share on other sites

3 hours ago, Snoman314 said:

Is there any more documentation on the LVD anywhere? I just can't seem to get started with it. The tutorial isn't much help, because it starts from a rocket launch, and at this point I build all me vessels in LKO. When I try to import the orbit data for a craft, it just... doesn't? I feel like there's an option somewhere I'm not setting, but I don't know what it is, hence asking about documentation. This is the problem:

I select the craft I want to import data from:

2t1ikUR.png

And then after I hit 'Use Selected Orbit', the values copied across are wildly different:

TWmReMW.png

What's going on here?

 

Changing topics, as I look around inside the LVD, I'm really excited about what it looks like it can do (Once I get past step 1), and the new textures are awesome!

Can I see the SFS file?  The parameters in the initial state dialog box look like they're still on the ground.

EDIT: And the MA MAT file, please, too.

Edited by Arrowstar
Link to comment
Share on other sites

1 minute ago, Arrowstar said:

Can I see the SFS file?  The parameters in the initial state dialog box look like they're still on the ground.

It does right? As you can see from the first screenshot, the vessel most definitely is not on the ground.

 

Spoiler

		VESSEL
		{
			pid = 73d636d398ac49bf90abd23858d2ae2d
			persistentId = 3574129056
			name = CommSat E1
			type = Relay
			sit = ORBITING
			landed = False
			skipGroundPositioning = False
			vesselSpawning = False
			launchedFrom = Runway
			landedAt = 
			displaylandedAt = 
			splashed = False
			met = 2453.7923806346953
			lct = 9725956.9433926903
			lastUT = 9728410.735773325
			distanceTraveled = 4870026.6988909366
			root = 0
			lat = -0.010884092524435382
			lon = -177.3724430142392
			alt = 977185.23272164445
			hgt = 977185.25
			nrm = 0.000109509623,0.702082753,-0.712095618
			rot = -0.651502848,0.651430249,-0.274950176,0.274927497
			CoM = 1.19455763E-07,-0.0189265888,-3.78116965E-07
			stg = 0
			prst = False
			ref = 0
			ctrl = True
			PQSMin = 2
			PQSMax = 9
			GroupOverride = 0
			OverrideDefault = False,False,False,False
			OverrideActionControl = 0,0,0,0
			OverrideAxisControl = 0,0,0,0
			OverrideGroupNames = ,,,
			altDispState = ASL
			cPch = 0.2
			cHdg = 0.3
			cMod = 0
			ORBIT
			{
				SMA = 5624365.3779364023
				ECC = 0.87592638623438546
				INC = 0.011174765272803635
				LPE = 181.90685422275445
				LAN = 150.23997672189074
				MNA = 0.098385617264910019
				EPH = 9728347.4957747385
				REF = 1
			}

 

https://drive.google.com/file/d/16y6PYyZa5qR4Ya2bF0BbL-3z36dIPvBJ/view?usp=sharing

In the meantime I'm rolling back through pre-release candidates to see if I can find one that works.

Link to comment
Share on other sites

14 minutes ago, Snoman314 said:

It does right? As you can see from the first screenshot, the vessel most definitely is not on the ground.

 

  Reveal hidden contents


		VESSEL
		{
			pid = 73d636d398ac49bf90abd23858d2ae2d
			persistentId = 3574129056
			name = CommSat E1
			type = Relay
			sit = ORBITING
			landed = False
			skipGroundPositioning = False
			vesselSpawning = False
			launchedFrom = Runway
			landedAt = 
			displaylandedAt = 
			splashed = False
			met = 2453.7923806346953
			lct = 9725956.9433926903
			lastUT = 9728410.735773325
			distanceTraveled = 4870026.6988909366
			root = 0
			lat = -0.010884092524435382
			lon = -177.3724430142392
			alt = 977185.23272164445
			hgt = 977185.25
			nrm = 0.000109509623,0.702082753,-0.712095618
			rot = -0.651502848,0.651430249,-0.274950176,0.274927497
			CoM = 1.19455763E-07,-0.0189265888,-3.78116965E-07
			stg = 0
			prst = False
			ref = 0
			ctrl = True
			PQSMin = 2
			PQSMax = 9
			GroupOverride = 0
			OverrideDefault = False,False,False,False
			OverrideActionControl = 0,0,0,0
			OverrideAxisControl = 0,0,0,0
			OverrideGroupNames = ,,,
			altDispState = ASL
			cPch = 0.2
			cHdg = 0.3
			cMod = 0
			ORBIT
			{
				SMA = 5624365.3779364023
				ECC = 0.87592638623438546
				INC = 0.011174765272803635
				LPE = 181.90685422275445
				LAN = 150.23997672189074
				MNA = 0.098385617264910019
				EPH = 9728347.4957747385
				REF = 1
			}

 

https://drive.google.com/file/d/16y6PYyZa5qR4Ya2bF0BbL-3z36dIPvBJ/view?usp=sharing

Alright, you did find a bug and I believe I've got it fixed.  I'll push out a fix for PR9 tomorrow.  In the mean time, copy/paste as needed. :)

Link to comment
Share on other sites

OK I got an additional out of memory error on pre-release 7. Next up pre-release 6.

SLVLglH.png

6 minutes ago, Arrowstar said:

Alright, you did find a bug and I believe I've got it fixed.  I'll push out a fix for PR9 tomorrow.  In the mean time, copy/paste as needed. :)

That's awesome, I look forward to start learning how to use it.

While you're squashing bugs... Pre-release 6 is the latest version I can find that has a working Mission Architect. See posts above about the orbit propagation erroring out.

Link to comment
Share on other sites

9 minutes ago, Snoman314 said:

While you're squashing bugs... Pre-release 6 is the latest version I can find that has a working Mission Architect. See posts above about the orbit propagation erroring out.

Yes, can I see the MA MAT files that you're working with?  It's the only way I can diagnose these things.  I'll take a look tomorrow.

Link to comment
Share on other sites

2 minutes ago, Arrowstar said:

Yes, can I see the MA MAT files that you're working with?  It's the only way I can diagnose these things.  I'll take a look tomorrow.

It's literally just: Import initial state -> add coast to ascending or descending node -> errors.

I'll fire it back up and upload shortly.

Link to comment
Share on other sites

5 hours ago, Arrowstar said:

Yes, can I see the MA MAT files that you're working with?  It's the only way I can diagnose these things.  I'll take a look tomorrow.

OK, here's the .mat file:

https://drive.google.com/file/d/1d2-ljODWscWlpxRf4HZOGO9LywzkSIhy/view?usp=sharing

This was made in pre-release9, if it matters.

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