Jump to content

[old thread] Trajectories : atmospheric predictions


Youen

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.

Link to comment
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.

Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
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. :)

Link to comment
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.

Link to comment
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 :)

Link to comment
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?

Link to comment
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 :)

Link to comment
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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...