Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Lets say I have a vector field that looks like this:

vector field

Where the x-component of each vector is x=x and the y-component is y=y.

Each of these vectors represents acceleration.

Now I "drop" a fresh particle (p) into the field at a certain position (p) which already has a velocity (v).

How can I calculate the new position (p2) and velocity (v2) of the particle after a specific time (t)?

From my basic understanding it has something to do with Line Integrals? However this doesn't help me much since it was years since I even solved simple integrals.

I'm doing this for a program I'm writing and I'm not well versed in the world of mathematics so I would really appreciate if you would keep the mathematic notation simple!

Hopefully I didn't miss any important piece of information.

Thanks, Andreas.

share|cite|improve this question
@bobobobo: please don't remove .stack to fix broken imgur links. This will result in having the picture on a server that isn't guaranteed to be permanent. Instead upload the picture another time. See Jeff's answer here for more on this. – t.b. Dec 30 '11 at 14:37
up vote 8 down vote accepted

An acceleration has units of length per time squared (or inverse length in natural units), and the vector field you describe has units of length, so there needs to be some factor of proportionality connecting the two. Let's say the acceleration is

$$\ddot{\vec{r}}=\lambda^2 \vec{r}\;,$$

where $\vec{r}$ is the position vector with components $x$ and $y$, a dot indicates differentiation with respect to time, and $\lambda^2$ is some positive proportionality constant which I've written as a square for later convenience. This is a second-order linear ordinary differential equation for $\vec{r}$, whose solution is

$$\vec{r}(t)=\vec{r}_1\mathrm e^{\lambda t}+\vec{r}_2\mathrm e^{-\lambda t}$$

with arbitrary vectors $\vec{r}_1$ and $\vec{r}_2$ which need to be determined using the initial conditions. Substituting your initial values $\vec{r}(0)=\vec{p}$ and $\dot{\vec{r}}(0)=\vec{v}$ yields

$$ \begin{eqnarray} \vec{r}_1+\vec{r}_2&=&\vec{p}\;,\\ \vec{r}_1-\vec{r}_2&=&\frac{\vec{v}}{\lambda}\;, \end{eqnarray} $$

with solution

$$ \begin{eqnarray} \vec{r}_1&=&\frac{1}{2}\left(\vec{p}+\frac{\vec{v}}{\lambda}\right)\;,\\ \vec{r}_2&=&\frac{1}{2}\left(\vec{p}-\frac{\vec{v}}{\lambda}\right)\;, \end{eqnarray} $$

so the overall solution is

$$\vec{r}(t)=\frac{1}{2}\left[ \left(\vec{p}+\frac{\vec{v}}{\lambda}\right)\mathrm e^{\lambda t} + \left(\vec{p}-\frac{\vec{v}}{\lambda}\right)\mathrm e^{-\lambda t} \right]\;. $$

This gives you the position at time $t$. To obtain the velocity at time $t$, you can differentiate with respect to time:

$$\dot{\vec{r}}(t)=\frac{1}{2}\left[ \left(\lambda\vec{p}+\vec{v}\right)\mathrm e^{\lambda t} - \left(\lambda\vec{p}-\vec{v}\right)\mathrm e^{-\lambda t} \right]\;. $$

To determine $\lambda$, take the square root of $\lambda^2$. Your units appear to be such that $\lambda^2=1$; in that case, you'd have $\lambda=1$.

[Edit:] I just realized that the vector field in your image doesn't look like the vector field you defined -- the vectors seem to all have the same length. If this is what you want the acceleration would be

$$\ddot{\vec{r}}=\lambda^2 \frac{\vec{r}}{|\vec{r}|}\;.$$

This can also be solved in closed form, but it's quite a bit more complicated, so I'll only work it out if that's what you need.

share|cite|improve this answer
And more generally, if $\vec{F}$ is any vector field. The position is the solution to the differential equation $\frac{d^2 \vec{r}}{d t^2} = \vec{F}(\vec{r})$ with $\vec{r}(0) = \vec{r}_0$ (initial position), $\frac{d \vec{r}}{d t}(0) = 0$ (assuming you drop the particle without velocity). But this might be complicated to solve depending on $\vec{F}$. – Joel Cohen May 14 '11 at 10:51
Looks really good. I will investigate this later. Just one question, can I apply this solution to other equations, like x=sin(x),y=sin(y)? – monoceres May 14 '11 at 11:36
@monoceres: I assume you mean that, like in the question, the $x$-component of acceleration is $\sin x$ and the $y$-component is $\sin y$. That would be $\ddot x=\sin x$, not $x=\sin x$, since it's the acceleration $\ddot x$ and not the $x$-component $x$ itself that you're specifying. To answer your question: You can apply this method of solution to any vector field, but not this solution. You have to solve a different differential equation for each vector field you specify for the acceleration. I don't think the one with the sines can be solved in closed form. – joriki May 14 '11 at 11:57
@joriki: The equation $d^2\phi/dt^2=\omega^2 \sin \phi$ can actually be solved in terms of elliptic functions. It's the equation for a pendulum (when the angle $\phi(t)$ is not assumed to be small), and the solution is known to be $$\phi(t)=2 \arcsin(k \operatorname{sn}(\omega t, k)),$$ where sn is Jacobi's sinus amplitudinis, and $k=\sin(\phi_{\mathrm{max}}/2)$. – Hans Lundmark May 15 '11 at 9:29
@joriki: This, by the way, leads to a funny argument for why the sn function is doubly periodic: If you replace $t$ by $it$, then the left-hand side of the ODE changes its sign. Moving that sign over to the right-hand side, we can think of this as changing the sign of $\omega^2=g/l$, that is, to swinging the pendulum with the gravity pointing upwards instead of downwards. This also gives a periodic motion, hence the sn function (with $0<k<1$) must have a purely imaginary period. According to Elliptic Curves by McKean & Moll (p. 77), this is due to Appell in 1870. – Hans Lundmark May 15 '11 at 10:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.