Non-uniform bi-linear interpolation

  • Thread starter Thread starter ponjavic
  • Start date Start date
  • Tags Tags
    Interpolation
ponjavic
Messages
221
Reaction score
0
I have a non-uniform grid within which velocity data is known at each grid point. This velocity data is to be interpolated to allow for evaluation of velocity at an arbitrary point inside the grid.

I am wondering about the correct approach to this problem. In actuality I want to evaluate the velocity using tri-cubic interpolation but considering the grid is non-uniform I would start with basics.

In the image you can sort of see what the grid looks like. I have for example points [1 2 3 4] and I want to evaluate the velocity at point X (x, y). dx is constant but dy is different between (x) and (x+1) therefore two different dy exist to account for this; dy1 and dy2.

So bilinear interpolation:
interpolate normally between 1 and 2 using dy1, interpolate between 3 and 4 using dy2, here comes the problem. I assume simply interpolating between the two found values using dx is enough? Possibly dx could be extended by the fact that it is now somewhat tilted (simple trigonometry). But then again the same tilt would apply to the position of X, i.e. the distance it is in x from point 1 and 2.

What is the correct way of doing this? I suppose if I figure out this it should not be too hard to extend to tri-cubic.
 

Attachments

  • interp.JPG
    interp.JPG
    5.7 KB · Views: 630
Physics news on Phys.org
I am not sure if you understand what tricubic means and I am not sure if I understand your grid.

I assume you have something like this, a set of coordinate points each consisting of three floating point numbers and a corresponding set of velocity vectors also consisting of three floating point numbers. We are talking about a velocity field, not the path of a single particle.

The first thing you do is splitting the interpolation into three parts one for each velocity component.

0) If it's physics alway try to fit a working theoretical model fist
otherwise:
1) I assume you have found the myriad of 1-d interpolation routines that are out there.
2) 2D is more tricky. And it depends a lot on your data. If your data is not really on any kind of grid, you can use RBFs radial basis functions, there are fit routines for that out there. They don't seem very popular.
You can force your data onto a grid. The grid is defined by the ticks on each axis. For that you can do some kind of nearest neighbor interpolation. Be warned: linear interpolation with nearest neighbors sucks. What you want to do is interpolation with natural neighbors. For that you need the Delaunay tesselation of the data. On a real grid you can then do bicubic b-splines or c-splines. There are routines for that.
3) Tricubic and n dimensional interpolation. It is very similar to 2d but this case is harder, because getting the nearest neighbors is harder, getting a Delaunay triangulation is much harder because some 2d tricks cannot be used. RBFs still work. I don't trust consecutive b-splining that much... but that is probably the way to go. I rolled my own cspline routine for this stuff about which I am not yet confident enough to share but it looks promising.

This might help:
http://www.scipy.org/Cookbook/Interpolation
 
0xDEADBEEF said:
I am not sure if you understand what tricubic means and I am not sure if I understand your grid.

I assume you have something like this, a set of coordinate points each consisting of three floating point numbers and a corresponding set of velocity vectors also consisting of three floating point numbers. We are talking about a velocity field, not the path of a single particle.

The first thing you do is splitting the interpolation into three parts one for each velocity component.

0) If it's physics alway try to fit a working theoretical model fist
otherwise:
1) I assume you have found the myriad of 1-d interpolation routines that are out there.
2) 2D is more tricky. And it depends a lot on your data. If your data is not really on any kind of grid, you can use RBFs radial basis functions, there are fit routines for that out there. They don't seem very popular.
You can force your data onto a grid. The grid is defined by the ticks on each axis. For that you can do some kind of nearest neighbor interpolation. Be warned: linear interpolation with nearest neighbors sucks. What you want to do is interpolation with natural neighbors. For that you need the Delaunay tesselation of the data. On a real grid you can then do bicubic b-splines or c-splines. There are routines for that.
3) Tricubic and n dimensional interpolation. It is very similar to 2d but this case is harder, because getting the nearest neighbors is harder, getting a Delaunay triangulation is much harder because some 2d tricks cannot be used. RBFs still work. I don't trust consecutive b-splining that much... but that is probably the way to go. I rolled my own cspline routine for this stuff about which I am not yet confident enough to share but it looks promising.

This might help:
http://www.scipy.org/Cookbook/Interpolation
I have a perfectly good understanding of tri-linear interpolation although my question might have seemed unclear. Here I was simply trying to find a solution for the bi-linear problem which I would the extrapolate to the tri-cubic one.

In any case I found a solution to the problem and it is "inverse bi-linear interpolation/transformation". This returns the ratios alpha and beta which describe how far along the x and y-axis respectively the point can be considered to be. Naturally these ratios can be used in place of the normal ratio (x_point-x_grid)/dx to conduct bi-linear interpolation.
 
##\textbf{Exercise 10}:## I came across the following solution online: Questions: 1. When the author states in "that ring (not sure if he is referring to ##R## or ##R/\mathfrak{p}##, but I am guessing the later) ##x_n x_{n+1}=0## for all odd $n$ and ##x_{n+1}## is invertible, so that ##x_n=0##" 2. How does ##x_nx_{n+1}=0## implies that ##x_{n+1}## is invertible and ##x_n=0##. I mean if the quotient ring ##R/\mathfrak{p}## is an integral domain, and ##x_{n+1}## is invertible then...
The following are taken from the two sources, 1) from this online page and the book An Introduction to Module Theory by: Ibrahim Assem, Flavio U. Coelho. In the Abelian Categories chapter in the module theory text on page 157, right after presenting IV.2.21 Definition, the authors states "Image and coimage may or may not exist, but if they do, then they are unique up to isomorphism (because so are kernels and cokernels). Also in the reference url page above, the authors present two...
When decomposing a representation ##\rho## of a finite group ##G## into irreducible representations, we can find the number of times the representation contains a particular irrep ##\rho_0## through the character inner product $$ \langle \chi, \chi_0\rangle = \frac{1}{|G|} \sum_{g\in G} \chi(g) \chi_0(g)^*$$ where ##\chi## and ##\chi_0## are the characters of ##\rho## and ##\rho_0##, respectively. Since all group elements in the same conjugacy class have the same characters, this may be...
Back
Top