Open TrentConley opened 5 months ago
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, Josh
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: https://github.com/machindustries/jsbsim/pull/2
I see, interesting.
Kind Regards, Josh
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, Josh
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?