Velocity field integration

106 Views Asked by At

Suppose we have a velocity field $$\mathbb{v}=\begin{bmatrix}v_x(x,y)\\ v_y(x,y)\end{bmatrix}$$ and the relation $$\frac{d\mathbb{v}}{dt}=f(\mathbb{v},t).$$ I am currently using Runge-Kutta's Method to numerically solve for $\mathbb{v}$. But I was wondering how should I go about using integration to solve for the position, namely if I know the velocity at $t=t_0$, how do I know the position at $t=t_0+\Delta t$? I can't just do $p(t)=p(t_0)+\mathbb{v}(p(t_0))\cdot \Delta t$ because it has a first order accuracy.

Any help would be appreciated!

2

There are 2 best solutions below

1
On

Recall that position and velocity are related as

$$ p(t) = p(t_0) + \int_{t_0}^t v (\tau) \mathrm d \tau. $$

The formula you give corresponds to the Riemann Left-Rule which is, as noted, limited in accuracy.

Essentially you are looking for some higher order Quadrature/Numerical Integration formula. For instance, you can settle for a Gauss-Quadrature of certain order and select the step-sizes $\Delta t_i$ of your Runge-Kutta method such that they match the required nodes of the quadrature.


Let's do the two-point Gauss-Legendre Quadrature. Since we are interested in the integral over $[t_0, t]$ instead of $[-1, 1]$ we have to transform the nodes $\xi_\pm = \pm \frac{1}{\sqrt{3}}$ accordingly.

This is easily done, in our case we have

$$ x_\pm = \frac{t-t_0}{2} \xi_\pm + \frac{t_0 + t}{2}. $$

We now need approximations to the velocity at these points. This can be done by adjusting the timesteps $\Delta t$ of the Runge-Kutta method accordingly (assuming linear stability), i.e., such that you have indeed approximations at $$ t_\pm = x_\pm = \frac{t-t_0}{2} \frac{1}{\sqrt{3}} + \frac{t_0 + t}{2}. $$

0
On

If you have a fixed velocity field, then the equations for an ODE based on that vector field are $$\dot x=v_x(x,y), \\ \dot y=v_y(x,y).$$ $\newcommand{\bo}[1]{{\mathbf{#1}}}\newcommand\bx{\bo x}\newcommand\bv{\bo v} $ If you have an acceleration that depends on position and velocity, then you get a 4-dimensional system $$\dot \bx=\bv, \\ \dot \bv=a(\bx,\bv,t),$$ but $v$ enters as component of the solution, not as vector field.

One could quasi combine both, a time-variable vector field $V(t,x)$ with evolution $\partial_t V=f(V,t)$. Then the evolution of the position $\dot \bx=V(\bx,t)$ requires the evolution of the full vector field at any place, or at least over a grid so that other positions can be interpolated. For a full dynamic one would need the second derivative $$ \ddot \bx=\partial_t V+\partial_xV\dot \bx = f(V(\bx,t),t)+\partial_xV(\bx,t)V(\bx,t) $$ but this would again require the evolution of the full field of derivatives via $$ \partial_t(\partial_xV)=\partial_Vf(V,t)(\partial_xV), $$ which does not really simplify the situation.