-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix aerodynamic torque simulations #22
Conversation
@dkavolis Should I open issues for the problems that this PR fixes? I realize in retrospect that I'm fixing one issue and adding a new feature (current aerodynamic torque) in one PR, which may not work well for you. |
Thanks for the PR, sorry it took so long to have a look at it.
|
If I recall correctly, FARCenterQuery was making a serious mathematical error that was causing results to be fairly erroneous. However, I need to make sure that I was correct in my original analysis, so let me get back to you on this one.
I'm not sure this makes sense; FARCenterQuery is fundamentally asking what the force is around a given point. It makes more sense to me to require that that point be specified rather than setting it to 0 in whatever frame of reference you happen to be using. This is more a design issue, however.
Abstracting over the means of force application is going to require a level of indirection, and it's not clear to me how to do it without allocation. The alternatives that I can come up with are:
I'll make the other changes soon. |
I think
With the
I think the first alternative would be the easiest and most extendable in the future if needed |
This reverts commit 32f0dfb.
I worked on it more, and FARCenterQuery was actually correct despite what I thought at the time; I've reverted the changes locally. The bad news is that I've been validating it again and the simulation forces are still broken; I thought I had fixed it, but apparently not. Going to be a bit longer, sadly. |
Update: torque is now applied consistently in the right direction, and total forces are consistently within 10% of actual values. Going to try to get this lower still though. |
The remaining 10% of error is due to issues in calculating local atmospheric density due to not knowing the time of day and therefore the solar-induced atmospheric heating. I'm going to call it good here, and address the usability/stability concerns from here on out. |
I think that's everything; @dkavolis can you please take a look again? |
Mostly good, just a couple of comments:
|
@dkavolis I think that's everything?
Yep, done, apologies for forgetting this originally.
It didn't seem to work for mysterious reasons the first time I tried it. I did an inline initalizer and it's fine? |
Apologies, missed those; is that sufficient? |
Looks like everything is done now, thanks. |
This pull request fixes Ferram Aerospace's simulations for torque and force, as well as adding new API endpoints that allow access to real-time force and torque information. Additionally, it refactors the CalculateAeroForces system to reduce code duplication, though it could be refactored further to avoid the lambda and associated generic method invocation overhead.