Python Forum
How can I know the value of a field at a random point?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I know the value of a field at a random point?
#1
Hello everyone.

I have recently been studying interpolation in python, specifically, using methods as the Radial basis functions, bicubic and so on.

I want this interpolation because I am working with an airplane trajectory optimization in the presencie of a wind field written in Pyomo and I only have the windspeed measured at grid points.

For what I have gathered, in all the interpolation formulae avaiable, I have to define a second grid, with a better resolution, in which the wind field is interpolated. As an example:

xi, yi = np.linspace(resulttokenX2.astype('float').min(), resulttokenX2.astype('float').max(), 100), np.linspace(resulttokenY2.astype('float').min(), resulttokenY2.astype('float').max(), 100)
xi, yi = np.meshgrid(xi, yi)

rbf = scipy.interpolate.Rbf(resulttokenX2, resulttokenY2, resulttokenF2, function='multiquadric')
zi = rbf(xi, yi)
I need a way to know the value of the windspeed at any point. I need to represent the windspeed as a function of x and y, like f(x, y)=5*x+3*y. I have tried with the Shannon interpolation. Unfortunately, the wind is badly reproduced even if the amount of terms is hughe. As an example, the attached figure is constructed using 6400 terms.

The only alternative I have found is the Barnes interpolation. Unfortunately, I cannot seem to find any python implementation.

So, can someone please tell me if an implementation is avaiable and if I can extract the resulting analytical expression of the random field to send it to the Pyomo code or (even better) if I can somehow call
scipy.interpolate.Rbf
or any other kind of interpolation inside of the Pyomo code and therefore have a new interpolation in each step of said code?

Any answer is appreciated.
Best regards.
Player1682.

Attached Files

Thumbnail(s)
       
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020