malcolmw / pykonal

Travel-time calculator based on the fast-marching method solution to the Eikonal equation.
https://malcolmw.github.io/pykonal-docs/
GNU General Public License v3.0
154 stars 55 forks source link

Is there an example of vector velocity field? #30

Closed whenwherewhy closed 1 year ago

whenwherewhy commented 1 year ago

Hi, Malcolm. Thanks for your sharing. It is really a great package. I am interested in figure_8.ipynb because of its potential application in the field of path planning. In this case, the velocity field is a scalar field. My understanding of this scalar field is that at every point in this Cartesian space, there is only the magnitude of the velocity and no direction information. In practice, velocity has both an x and a y component in a two-dimensional Cartesian plane. Does it still apply in the vector field? Maybe an example or suggestion for figure_8.ipynb in VectorField is ok. Thank you!

malcolmw commented 1 year ago

If I understand your question correctly, the answer is that the Fast Marching Method only works for scalar propagation speeds. The vector velocity of an agent at a given position along its trajectory, however, is proportional to the gradient of the scalar travel-time field at that position. The gradient is exposed through the EikonalSolver.traveltime.gradient attribute.

I hope this helps.

- Malcolm

whenwherewhy commented 1 year ago

Hi, thanks for the reply. It helps a lot. My question comes from the two classes, ScalarField3D and VectorField3D. In the given jupyters, all the velocity fields are ScalarField3Ds. So I'm curious if there is an example of VectorField3D velocity. After reading the Statement of the Problem in the attached paper, I understand further. The zero-phase wavefront propagates perpendicular to itself with velocity v. In my opinion, although the velocity field is a scalar field, there is an assumption that the velocity is vertically outward. It seems that the velocity component in the tangential direction of the wavefront is zero. If the tangential component of the velocity is not zero, can we solve that as well? In this case, the velocity field can be represented by VectorField3D with a shape of (N0,N1,N2,3). Tangential and vertical velocity component fields are still scalar fields with the shape of (N0,N1,N2). The two scalar fields make up the vector velocity field with indices of  (N0,N1,N2,0) and (N0,N1,N2,1). I've thought of these so far, but I'm not sure if they are feasible. Just like the ripples of a drop of water. When the water surface is calm (scalar velocity field), the circular ripples propagate outward to form a series of concentric ripples. When there is water velocity on the water's surface (a vector velocity field), the propagation of ripples must take into account the direction of velocity rather than just the vertical outward of concentric circles. Maybe this is a bit fanciful, but I'm looking forward to your reply.

malcolmw commented 1 year ago

Sorry for dropping off on this, @whenwherewhy. It is an interesting class of problems you raise here, but not currently possible to solve with the Fast Marching Method that PyKonal implements. Do you have a research problem in mind? Or ar you just pondering?