Jump to content

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


Recommended Posts

Thanks. I think I've got it fixed. Take a look, please: KSP TOT v1.5.1 pre-release 6

Still some issues. The proper node is coasted to now for my Mi-SCAN probe, but it is 0.3 degrees off the equator both ways (not sure if that's a big deal just noting it) and here's what my Duna I probe does at coast to descending node.

sE5qTSRl.png

Here, this is my latest SFS with a bunch of craft to test against. Funny enough is I just found my own orbital edge case to deal with on my flight tracker :P will have to completely refactor my plot render code because it assumes all lines cross the meridian before going off a map edge. My first attempt locks up the browser haha. Fun times

mswO5ksl.png

Edited by Gaiiden
Link to comment
Share on other sites

Here's another weird way, that I suspect may shed some light on this issue. I tried to upload a maneuver node from Mission Architect, the upload maneuver window seemed perfectly sane, and precise node showed the node as being uploaded appropriately, However, KSP seemed to disagree, as shown.:

http://imgur.com/ZxZxmDo

I tried it again with the vectors set to 0, and still received that large DV requirement. I changed around the UT both in KSPTOT and precise node, that changed that large DV value. It looks like this has to do with the UT somehow, or perhaps something being passed with it

Edited by dlrk
Link to comment
Share on other sites

Still some issues. The proper node is coasted to now for my Mi-SCAN probe, but it is 0.3 degrees off the equator both ways (not sure if that's a big deal just noting it) and here's what my Duna I probe does at coast to descending node.

http://i.imgur.com/sE5qTSRl.png

Here, this is my latest SFS with a bunch of craft to test against. Funny enough is I just found my own orbital edge case to deal with on my flight tracker :P will have to completely refactor my plot render code because it assumes all lines cross the meridian before going off a map edge. My first attempt locks up the browser haha. Fun times

http://i.imgur.com/mswO5ksl.png

Okay, now I think I have it fixed. :P I finally went to the solution I had been trying to be clever and avoid, which is to find the true anomaly that minimizes the angle between that true anomaly's position vector and the line of nodes. It's a little more CPU intensive, but I think it's fast enough for general applications.

KSP TOT v1.5.1 pre-release 7

Here's another weird way, that I suspect may shed some light on this issue. I tried to upload a maneuver node from Mission Architect, the upload maneuver window seemed perfectly sane, and precise node showed the node as being uploaded appropriately, However, KSP seemed to disagree, as shown.:

http://imgur.com/ZxZxmDo

I tried it again with the vectors set to 0, and still received that large DV requirement. I changed around the UT both in KSPTOT and precise node, that changed that large DV value. It looks like this has to do with the UT somehow, or perhaps something being passed with it

Can I get a clean (stock only) SFS file that demonstrates the problem and instructions on how to reproduce the issue? I don't think I'm going to be able to help with just pictures. I'm not really understanding what you're trying to describe...

Link to comment
Share on other sites

Okay, now I think I have it fixed. :P

Yeap looks good over here.

Also, I know this isn't a huge deal but because I really like breaking stuff (as you've noticed) if you're quick enough to close the title screen dialog the whole program craps out when the main window loads. If you don't want to fix it I promise to keep myself from doing it ever again :D

Link to comment
Share on other sites

Also, I know this isn't a huge deal but because I really like breaking stuff (as you've noticed) if you're quick enough to close the title screen dialog the whole program craps out when the main window loads. If you don't want to fix it I promise to keep myself from doing it ever again :D

Could not reproduce. I got an error message within MATLAB itself but the application otherwise loaded fine. I'll add a check on the validity of the splash dialog graphics handle before I close it, but I think that may be all I can do.

Are you aware of any other issues I need to address before v1.5.1 goes live?

Link to comment
Share on other sites

Could not reproduce. I got an error message within MATLAB itself but the application otherwise loaded fine. I'll add a check on the validity of the splash dialog graphics handle before I close it, but I think that may be all I can do.

That should do it. The error dialog that pops up mentions an invalid handle. When I close that the application exits.

Are you aware of any other issues I need to address before v1.5.1 goes live?

I currently have none and also don't recall any mentioned previously here in the thread that are still open other than dlrk's

Link to comment
Share on other sites

Arrowstar,

I tested this some more, and I have an SFS of which no mods were used aside from Hyperedit(in order to get a vehicle in orbit for testing), 64k(because the problem doesn't occur without it) and KSPTOTConnect.

Steps to reproduce are to, using 64k(6.4x Kerbin with Kopernicus):

1. Warp to/already be at or after year 1 day 115 (may occur earlier, but definitely occurs by then, and not on the first day or so)

2. Attempt to calculate a transfer to the Mun using KSPTOT's RMS.

3. Observe that the resulting maneuver, whether uploaded or entered manually, does not result in an encounter.

SFS: https://www.dropbox.com/s/tbhqex37ztt676k/persistent.sfs?dl=0

Link to comment
Share on other sites

Arrowstar,

I tested this some more, and I have an SFS of which no mods were used aside from Hyperedit(in order to get a vehicle in orbit for testing), 64k(because the problem doesn't occur without it) and KSPTOTConnect.

Steps to reproduce are to, using 64k(6.4x Kerbin with Kopernicus):

1. Warp to/already be at or after year 1 day 115 (may occur earlier, but definitely occurs by then, and not on the first day or so)

2. Attempt to calculate a transfer to the Mun using KSPTOT's RMS.

3. Observe that the resulting maneuver, whether uploaded or entered manually, does not result in an encounter.

SFS: https://www.dropbox.com/s/tbhqex37ztt676k/persistent.sfs?dl=0

Hi there. So any idea why you can't reproduce it in a purely stock game? That's critical. Can you take a look at your bodies file and see if it makes sense? Can you try to use RMS with another spacecraft? Does that work. If you can use RMS with another s/c but it doesn't work on the moon, then the bodies.ini file is not correct.

Link to comment
Share on other sites

https://www.dropbox.com/s/ohi4oienhsk1pnf/persistent%20%282%29.sfs?dl=0

Well, I just tried again to reproduce it in stock, and it reproduced. No mods aside from KSPTOTConnect and Hyperedit. SFS is attached. I created a new bodies file from the stock system, and tried that, and tried with the included bodies file, with the same result. On this try epoch didn't seem to affect it, as long as it was a game hour or so in.

Link to comment
Share on other sites

Going to go a bit off topic here but I noticed a while ago you were working on an interesting Launch Trajectory Analysis tool.

http://forum.kerbalspaceprogram.com/threads/36476-WIN-MAC-KSP-Trajectory-Optimization-Tool-v1-5-0-Optimizations!?p=2074193&viewfull=1#post2074193

If you still have any plans to work on it. Would it perhaps be possible to implement some kind of solver like this? http://forum.kerbalspaceprogram.com/threads/65011-WEB-1-0-KSP-Optimal-Rocket-Calculator-v1-19/ Especially if you can simulate atmospheric flight.

I know that has little to do with slingshots. Yet it really would be useful for designing cost effective lifters for a variety of missions.

Link to comment
Share on other sites

https://www.dropbox.com/s/ohi4oienhsk1pnf/persistent%20%282%29.sfs?dl=0

Well, I just tried again to reproduce it in stock, and it reproduced. No mods aside from KSPTOTConnect and Hyperedit. SFS is attached. I created a new bodies file from the stock system, and tried that, and tried with the included bodies file, with the same result. On this try epoch didn't seem to affect it, as long as it was a game hour or so in.

Okay, thanks. I will take a look when I can. In the meantime, could you please provide for me exact instructions, starting from loading up KSP, that demonstrate how to reproduce the issue you're seeing?

Going to go a bit off topic here but I noticed a while ago you were working on an interesting Launch Trajectory Analysis tool.

http://forum.kerbalspaceprogram.com/threads/36476-WIN-MAC-KSP-Trajectory-Optimization-Tool-v1-5-0-Optimizations!?p=2074193&viewfull=1#post2074193

If you still have any plans to work on it. Would it perhaps be possible to implement some kind of solver like this? http://forum.kerbalspaceprogram.com/threads/65011-WEB-1-0-KSP-Optimal-Rocket-Calculator-v1-19/ Especially if you can simulate atmospheric flight.

I know that has little to do with slingshots. Yet it really would be useful for designing cost effective lifters for a variety of missions.

I've put this on hold for now. I ran into some algorithmic and run time problems and haven't had a chance to work them out. Hopefully I'll be able to in the future, we'll see. Thanks for your interest! :)

Link to comment
Share on other sites

Okay, thanks. I will take a look when I can. In the meantime, could you please provide for me exact instructions, starting from loading up KSP, that demonstrate how to reproduce the issue you're seeing?

As far as I can see, reproduction should simply be:

Start KSP

Start KSPTOT.

Open Rendezvous Maneuver Sequencer

Get Orbit from KSP in initial orbit

Slect Mun in target orbit.

Compute rendezvous.

Upload maneuver generated.

Observe that the maneuver does not lead to an encounter with the Mun.

I'm not sure why everyone else wouldnt be having this issue

Link to comment
Share on other sites

testing aerobraking again over Duna, have noticed you can't change line colors for aerobrake events. Will report back with results of aerobrake, got my coefficients ready to go

Also noticed that the Other Spacecraft menu hasn't been updated with the changes I suggested and you agreed to in regards to disabling the input boxes until Add Spacecraft is clicked if none are created yet

yikes, my calculated dip through 40km of Duna was supposed to give me an apodun of 1,625km and afterwards I'm at 1,439km. I'm going to go review my methods and be back with a full report so you can determine if it's something I did wrong getting my coefficients and setting up the aerobrake states

Edited by Gaiiden
Link to comment
Share on other sites

Hi, i would really like to use your tool but when i try creating bodies.ini because im using 6.4x ksp so the planet size and other stuff would match. I have installed KSPTOTConnect and i was in the flight scene on one of my sattelites and when i try creating boides.ini it gives me an error. It asks is KSPTOTConnect installend and ksp is running in flight-mode. I have met both requirements. Maybe it's something that im running 64-bit windows version of KSP. I need to use it becuase i have a sh** ton of mods. Btw awesome and very useful tool :D

Link to comment
Share on other sites

As far as I can see, reproduction should simply be:

Start KSP

Start KSPTOT.

Open Rendezvous Maneuver Sequencer

Get Orbit from KSP in initial orbit

Slect Mun in target orbit.

Compute rendezvous.

Upload maneuver generated.

Observe that the maneuver does not lead to an encounter with the Mun.

I'm not sure why everyone else wouldnt be having this issue

Just a reminder to Arrowstar this seems similar to the problem I discovered a while back where RSS was adjusting the orbital period of various stock bodies in the system, throwing off my intercepts with Mun and Minmus in a similar manner. Dlrk you may want to use a tool like VOID or Kerbal Engineer that have in-game catalogs that can show you orbital periods for bodies and compare those values to the KSP wiki

Arrowstar should have that areobraking analysis for ya tonight or tomorrow

Link to comment
Share on other sites

The orbital period doesn't match the stock orbital period, but I'm not sure that it's supposed to.

Oh, true. I forgot you're using a changed kerbol system. Very well then make sure the orbital periods that you see in the game match the orbital periods that are in the bodies.ini file you generated.

Link to comment
Share on other sites

I don't see orbital period in bodies.ini at all, should it be there? I see rotperiod, but I believe thats rotation not orbit.

Though, since the problem occured in stock as well, I'll check that too

Bodies.ini has the SMA and GM values for each body, but indeed not directly the orbital period.

Orbital Period = 2 * PI * √ (SMA(x)^3 / GM(y)), of course the gravitational parameter GM is from the mainbody, the SMA is from the actual body you want to compute.

E.g. for Kerbin: SMA(kerbin) = 13599840.256; GM(Sun) = 1172332794.832490700 (data from stock KSP and KSPTOT, but the equation works with anything); Orbital Period = 9,203,544.6175 s

Link to comment
Share on other sites

Hrm, I'm all outta help then for now. Could not reproduce. Try walking us through the EXACT steps you take. I mean specific and detailed. Maybe with images.

WTNIqfZm.png

Arrowstar, I've gone back over my aerobrake procedure and I'm pretty sure I did everything right. Here are some MAT files for you to look at. DipSequence2 - #1 results.mat contains orbital states pulled from the game just before entering and just after leaving the atmosphere (50km). Coupled with a pre-aerobrake mass of 12.293t (why does it matter that it's pre-aerobrake?) I calculated my drag coefficient which you see applied for the first aerobrake event in DipSequence3.mat. Speaking of pre/post dip you have inclination defined as just "inclination" but the instructions refer to the inclination prior to aerobrake so shouldn't it be moved to the top and labeled pre-aerobrake? There was a slight change to my inclination after the aerobrake. I don't know if using either one would cause any significant change to the result to really fuss over this though. So yea, first aerobrake pass shown in KSPTOT says I should be at 1624km Ap but I actually ended up at 1439km. Profile of the craft was the same as when I first calculated the coefficient - RemoteTech held the craft prograde and all solar panels/comms/doors were closed. I also think it's a bit hinky that if I change the model in the aerobrake event from Stock to FAR to NEAR the results are exactly the same...

Edited by Gaiiden
Link to comment
Share on other sites

What could be the reasons that i cant create bodies.ini? I have KSPTOTConnect installed and i have opened a satelite which is in an orbit around Kerbin but it sill won't let me create bodies.ini file. It gives me an error and is asking if KSPTOTConnect is installed and if KSP is running in fly-mode in background. Maybe it has something to do with KSP that im using which is 64bit? I would really like to use this tool :D

Link to comment
Share on other sites

After uninstalling and reinstalling MATLAB, stock KSP now works fine. I went back to trying to create a bodies from KSP using the latest KSP. Creating a file failed with a chord, and this ksptot.log entry

Index exceeds matrix dimensions.

Error in getBodiesINIFileFromKSP (line 26)

Error in mainGUI>createNewBodiesFileFromKSP_Callback (line 656)

Error in gui_mainfcn (line 95)

Error in mainGUI (line 42)

Error in @(hObject,eventdata)mainGUI('createNewBodiesFileFromKSP_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating Menu Callback

Error writing to output stream.

Index exceeds matrix dimensions.

Error in getBodiesINIFileFromKSP (line 26)

Error in mainGUI>createNewBodiesFileFromKSP_Callback (line 656)

Error in gui_mainfcn (line 95)

Error in mainGUI (line 42)

Error in @(hObject,eventdata)mainGUI('createNewBodiesFileFromKSP_Callback',hObject,eventdata,guidata(hObject))

Error while evaluating Menu Callback

Error writing to output stream.

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