-
Notifications
You must be signed in to change notification settings - Fork 461
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
JSBSim can't interpolate between n dimensions #1117
Comments
Maybe I am missing something, but why not use the "table" lookup and breakPoint="" to create a 3D table rather than using interpolate1d? Kind Regards, |
It's fine to create a 3D table. But let's say you have aerodynamic data across 7 control surfaces, now you need at least 7 dimensional data. Currently, JSBSim can't handle that to my understanding. I made a modification to a fork of JSBSim, and I could bring that into main as well. Check out this PR that introduced it: |
I see, Kind Regards, |
Took a quick look. I REALLY like this. Would be awesome to see this move into JSB/FlightGear. I could definitely make use of this in my flight models. Kind Regards, |
Cool! I'll work on integrating it into JSBSim then. |
I've read an implemented Jon's advice here, but it looks like the nester interpolation is not happening, since the
GetValue()
function called on the parameters provides a double value rather than calling interpolate again. Seesrc/math/FGFunction.cpp
at line 691.For the RC craft I am working on, I'll need at least 6 dimensions to interpolate from to produce 6 distinct aerodynamic coefficients.
Below are two examples of how I was setting up the nested interpolation. Neither worked since they each only interpolated once:
To resolve this, I am planning on creating a nxm matrix where n is the number of dimensions I am need to interpolate from and m is the number of data points I have. This would be in place of the table. Technically, I could only store n-1 dimensions in the matrix since I am planning on having the last row be the coefficient value. Then, I'll created a new function interpolateNd that can interpolate between the vectors in the matrix.
Any thoughts on a better implementation?
The text was updated successfully, but these errors were encountered: