Calculating path of a particle in a vector field

538 Views Asked by At

I have a file with .dat extension in which I have data for a vector field in form of columns arranged in order {position vector_x, position vector_y,x_magnitude,y_magnitude}. If I pick a specific position vector(x,y) and let's say drop a particle and I want to trace the trajectory of the particle for some time period. I have seen problems like having a vector field in some algebraic form and using Euler, Runge-Kutta method but with my problem, I am not sure what I should do any ideas would be appreciated.

1

There are 1 best solutions below

7
On

You can do some really easy iterations given a velocity field. The most basic iteration would be something like $$ \vec{X}_{k+1} = \vec{X}_{k} + \varepsilon \vec{V}_{k} $$ for small step sizes $\varepsilon$ where $\vec{X}$ is of course postition and $\vec{V}$ is of course velocity.

It would probably be a good idea to change the value of $\varepsilon$ at each iteration to adjust for when $\vec{V}_k$ gets very large. If the velocities in your fluid flow vary wildly, perhaps choosing something like $$\varepsilon_k = \frac{\alpha}{\|\vec{V}_k\|}$$

for some small constant $\alpha$ would be wise.

Methods like RK4 are always popular as well by treating

$$ \vec{V}_k = \vec{V}(\vec{X}_k) = \dfrac{\text{d}\vec{X}}{\text{d}t}(t,\vec{X}_k) \text{ .}$$