Youen

[old thread] Trajectories : atmospheric predictions

Recommended Posts

Version 1.2.0 (beta) is published on github https://github.com/neuoy/KSPTrajectories/releases

It should work for vaccum predictions and FAR. It doesn't work fot stock aerodynamics at this time. Also, I have only tested it on a single flight, so you could expect bugs.

Thanks Youen! I tested it out and it worked for a retrograde reentry just fine.

I was trying out the FARAPI, but was getting nonsense results. Upon examining your code, I was using stock rho instead of FAR rho and I had messed up the world vector. WARNING! I found during tests that the calculatevesslforces call can induce aerodynamic failures in wings in extreme cases. I opened a github issue on FAR. So if someone here tries to predict a really steep trajectory from a really high velocity, your fins/wings might get ripped off for no apparent reason while still in orbit. The good news is that if the predictions are accurate they were going to get ripped off anyways.

I am making some progress on stock aero. I'll report back as I try a few things out.

Share this post


Link to post
Share on other sites

I believe MechJeb made some progress with stock aero landing predictions. Maybe check their way out?

Share this post


Link to post
Share on other sites
I believe MechJeb made some progress with stock aero landing predictions. Maybe check their way out?

@futrtubl, indeed Mechjeb implements predictions for stock aero. Almost everything I've learned is based on trying to back out what MechJeb is doing and comparing to Trajectories. I'm learning I have forgotten all my vector math from college.

I've also learned there are several drag curves that are functions of mach and well as direction, each part has a drag cube, such that vessel drag is a linear combination of those part drags (as a function of direction). Air density is important, and is a function of the temperature, which varies by location. All this has to be pieced together in such a way to determine total drag force for a vessel for use in Trajectories.

I haven't even discussed lift yet. :D (Lift actually looks simpler).

Compare to what ferram did, which was to hand all that off a single API call that figures the total drag/lift for any velocity direction you want in FAR. ferram = awesome.

Anyways, I've got a test plugin I'm building to try to pull the stock aero lift/drag out as a prediction. My hope is to build something that can be plugged right into Trajectories.

Anyone else lurking out there and want to discuss stock aero? I'm thinking of starting a thread in Plugin Development.

Share this post


Link to post
Share on other sites
@futrtubl, indeed Mechjeb implements predictions for stock aero. Almost everything I've learned is based on trying to back out what MechJeb is doing and comparing to Trajectories. I'm learning I have forgotten all my vector math from college.

I've also learned there are several drag curves that are functions of mach and well as direction, each part has a drag cube, such that vessel drag is a linear combination of those part drags (as a function of direction). Air density is important, and is a function of the temperature, which varies by location. All this has to be pieced together in such a way to determine total drag force for a vessel for use in Trajectories.

I haven't even discussed lift yet. :D (Lift actually looks simpler).

Compare to what ferram did, which was to hand all that off a single API call that figures the total drag/lift for any velocity direction you want in FAR. ferram = awesome.

Anyways, I've got a test plugin I'm building to try to pull the stock aero lift/drag out as a prediction. My hope is to build something that can be plugged right into Trajectories.

Anyone else lurking out there and want to discuss stock aero? I'm thinking of starting a thread in Plugin Development.

Yeah, really surprised stock didn't expose something similar. Oh well, doesn't affect me too much ass I am a FAR man to the core.

Share this post


Link to post
Share on other sites
WARNING! I found during tests that the calculatevesslforces call can induce aerodynamic failures in wings in extreme cases.

I had the same issue with the previous version, and what I did was setting a very high tolerance on all parts (by C# reflection) just before performing the computations, and restoring the previous value just after. I did the same with the stall state of wings, because the cache system of the prediction works only for stateless aerodynamics (though I haven't make measurements to see if it really changed something). I think the same hack should still work, I'll take a look. And when/if ferram fixes the thing I'll remove the hack.

I am making some progress on stock aero. I'll report back as I try a few things out.

Thanks for that :-)

Edited by Youen

Share this post


Link to post
Share on other sites
Is any compatibility for nuFAR planned/considered?

See last page. FAR compatibility is further along than stock, AFAIK.

Version 1.2.0 (beta) is published on github https://github.com/neuoy/KSPTrajectories/releases

It should work for vaccum predictions and FAR. It doesn't work fot stock aerodynamics at this time. Also, I have only tested it on a single flight, so you could expect bugs.

Share this post


Link to post
Share on other sites
See last page. FAR compatibility is further along than stock, AFAIK.

Thank you for the fast response. Awesome.

Share this post


Link to post
Share on other sites
I had the same issue with the previous version, and what I did was setting a very high tolerance on all parts (by C# reflection) just before performing the computations, and restoring the previous value just after. I did the same with the stall state of wings, because the cache system of the prediction works only for stateless aerodynamics (though I haven't make measurements to see if it really changed something). I think the same hack should still work, I'll take a look. And when/if ferram fixes the thing I'll remove the hack.

ferram just closed the github issue and committed some changes, next version of FAR should not rip wings off anymore. So don't work too hard on that hack. :)

Share this post


Link to post
Share on other sites

OK, great (I didn't start yet anyway ^^)

Share this post


Link to post
Share on other sites
Any chance of getting this via Ckan? :)

It's already indexed by CKAN, but it would have to be updated on Kerbal Stuff.

Share this post


Link to post
Share on other sites

The version on Kerbalstuff is still 1.1.3

Thank you so much for the update. Installed and testing now.

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites

Does anyone else FPS drop to to almost 0, when plotting a trajectory that intercept an atmosphere in another SOI ?

Edited by luckyhendrix

Share this post


Link to post
Share on other sites

Awesome, this is a very awesome mod, any chances of it eventually working on the stock model? Doesn't flight integrator helps?

Share this post


Link to post
Share on other sites
Awesome, this is a very awesome mod, any chances of it eventually working on the stock model? Doesn't flight integrator helps?

The problem is FAR nicely provides a method to just ask it for the data and it provides it. Stock does not. Even worse we can't see the stock code and how it actually does it like we can with FAR so the best you can do is guess and see how well that matches what you see in the game.

Share this post


Link to post
Share on other sites

Hey fellas,

Everyone here happy with the mod uses FAR ?

Just to be sure the atmospheric trajectories dont work on stock aerodynamics?!

Will it be updated for stock aero shorty?

dont wanna miss out on that mod and dont wanna go back to FAR :)

Share this post


Link to post
Share on other sites

I don't use FAR (I did in 0.90). Trajectories does not display for me in the TS. No icon in stock nor blizzy's toolbar. Perhaps competing with another mod??

Share this post


Link to post
Share on other sites

@Apollo13 @tubo

Seriously, just read the post above both of yours. I've asked a similar thing and @futrtrubl answered...

Share this post


Link to post
Share on other sites

I love this mod so much that I went back to FAR just so I could use it. But when I plot a maneuver to leave Mun's SOI to go back to Kerbin, the game freezes and/or crashes. It's happened everytime with the two ships I tested this on. The only workarounds were to either disable Trajectories from the toolbar or uninstall the mod, perform the maneuver, leave the SOI and then reinstall.

Anybody else getting this?

Share this post


Link to post
Share on other sites

Somehow Trajectories doesn't appear in CKAN right now; please fix that :)

Update: ah, it's because KerbalStuff still has the outdated version. Please fix that too :)

Share this post


Link to post
Share on other sites
I love this mod so much that I went back to FAR just so I could use it. But when I plot a maneuver to leave Mun's SOI to go back to Kerbin, the game freezes and/or crashes. It's happened everytime with the two ships I tested this on. The only workarounds were to either disable Trajectories from the toolbar or uninstall the mod, perform the maneuver, leave the SOI and then reinstall.

Anybody else getting this?

I'm getting the same thing, its filling the log with:

"[LOG 20:40:12.574] Trajectories: WARNING: FAR/NEAR totalForce is NAN (altitude=3000, airVelocity=3000, angleOfAttack=0

[LOG 20:40:12.576] Trajectories: getting FAR forces

[LOG 20:40:12.578] Trajectories: got FAR forces

[LOG 20:40:12.579] Trajectories: WARNING: FAR/NEAR totalForce is NAN (altitude=3000, airVelocity=3000, angleOfAttack=0

Ill try to work out how to give you the full log if I can.

Cheers, Dave.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.