Find quickest line of interception to a moving object

360 Views Asked by At

First, a visual illustration of the problem:
http://tube.geogebra.org/m/1512793

The goal is to mathematically predict the direction in which the player need to run to intercept the ball as fast as possible and how long it will take for the player to reach the ball.

The following properties are considered known:

  • Initial ball position $B_x, B_y$
  • Initial ball speed $Bv_0$
  • Ball direction $\beta$
  • Initial player position $P_x, P_y$
  • Potential speed of the player $P_S$
  • Ball friction coefficient $R$

There will be friction working against the ball's movement. These differential equations will model the movement of the ball:

$x''(t) = -Rx'(t)$

$y''(t) = -Ry'(t)$

This should give the following equations for the ball's position:

$x(t) = B_x - \frac{Bv_0 * \cos(\beta)}{R}(e^{-Rt}-1) $

$y(t) = B_y - \frac{Bv_0 * \sin(\beta)}{R}(e^{-Rt}-1) $

The player's potential movement can be described using a circle whose center is the player, and whose radius is $t*P_S$.

At a given time $t$, the circle represents every possible position for the player, provided that he has been running with constant speed in a straight line since $t = 0$.

The circle can be modeled in the following way:

$x(s, t) = P_x + P_St*\cos(s)$

$y(s, t) = P_y + P_St*\sin(s)$

$ s \in [0, 2\pi]$

So, the intuitive solution to this is to set the equations equal to eachother.

$B_x - \frac{Bv_0 * \cos(\beta)}{R}(e^{-Rt}-1) = P_x + P_St*\cos(s)$

$B_y - \frac{Bv_0 * \sin(\beta)}{R}(e^{-Rt}-1) = P_y + P_St*\sin(s)$

which is, as far as I can tell, basically unsolvable.

Or?

EDIT

As suggested in the comments, I could also use a constant friction.

Then I would end up with these equations (might be incorrect):

$-\frac{1}{2}R\cos{\beta}t^2+Bv_0\cos{\beta}+B_x = P_x + P_St\cos{s}$

$-\frac{1}{2}R\sin{\beta}t^2+Bv_0\sin{\beta}+B_y = P_y + P_St\sin{s}$

I'm not sure if these are easily solvable either? At least I'm not able to do it.

EDIT 2

As suggested in the comments, numerical solving might work. As someone who has little experience of using numerical methods, could someone give an explanation of how it could be used?

1

There are 1 best solutions below

3
On

Let $(x_B(t), y_B(t))$ be the ball's position at time $t$. For example, according to your first proposed equations of motion,

\begin{align} x_B(t) &= B_x - \frac{B_{v_0} \cos\beta}{R}(e^{-Rt}-1), \\ y_B(t) &= B_y - \frac{B_{v_0} \sin\beta}{R}(e^{-Rt}-1). \end{align}

Now let $r(t)$ be the distance (at an arbitrary point in time) from the ball to the player's starting position. Then $$ (r(t))^2 = (x_B(t) - P_x)^2 + (y_B(t) - P_y)^2. $$

In order for the player to intercept the ball as soon as possible, we want to find the first time $t$ such that the player can just barely reach the ball's position at time $t$. But the maximum distance from the player's starting point to the player's position at time $t$ is of course $P_S t$. So we want the minimum $t$ such that $r(t) = P_S t$, which is also the minimum positive $t$ such that $(r(t))^2 = (P_S t)^2$, that is, $$ f(t) = (x_B(t) - P_x)^2 + (y_B(t) - P_y)^2 - (P_S t)^2 = 0. \tag 1 $$

I suggested using the squares of distances because using the ordinary distance would put most of the above formula inside a square root.

Even without a square root, this may be an ugly formula, especially when you write out the values of $x_B(t)$ and $y_B(t)$ in terms of $t$ and the known quantities, but it has only one unknown variable and can be solved by various numeric methods for any given values of the known quantities.

Suppose you have solved for $t$ in Equation $(1)$, and the least solution is $t_1$. That is how long it takes for the player to reach the ball.

You can then compute the coordinates of the point $(x_B(t_1), y_B(t_1))$ of the point where the player must intercept the ball. It is then a relatively simple matter to compute the direction from $(P_x,P_y)$ to $(x_B(t_1), y_B(t_1))$; that is the direction in which the player should run.


To solve for $t$ numerically, I think either Newton's method or the secant method would work, provided that you start with good guesses. Clearly, $t$ has to be at least great enough for $P_S t$ to be equal to or greater than the distance from $(P_x,P_y)$ to the line the ball travels. But if $f'(t)$ is still positive at that time, you need a larger value of $t$. One way to come up with good "first guesses" for either the Newton or secant method might be to find a sequence of "minimum" values of $t$, starting with $t$ so that $P_S t$ is the distance from $(P_x,P_y)$ to the line the ball travels; the for each new guess, find the position of the ball at the time of the previous guess and set $t$ so that $P_S t$ is the distance from $(P_x,P_y)$ to that position of the ball. You will never catch up with the ball that way (Zeno's paradox), but eventually you will reach a point where $f'(x)$ is negative (if you have worked out $f'(t)$) or where $f(t)$ is less than it was at the previous guess, and at that point I think you will find either of these methods will converge.

There is another thing to watch out for if you assume constant friction, however. The position of the ball then is given by

\begin{align} x_B(t) &= -\frac12 R(\cos{\beta})t^2 + B_{v_0}(\cos{\beta})t + B_x, \\ y_B(t) &= -\frac12 R(\sin{\beta})t^2 + B_{v_0}(\sin{\beta})t + B_x. \end{align}

(Note the factor of $t$ which is missing from the formulas you posted earlier). If you apply these formulas naïvely, then as $t$ increases to infinity, eventually the formulas will say the ball is moving backwards. There is a time $t$ at which that formula says the ball's speed is zero, and the ball's position at that time is its final position; after that time the ball should not move from that position. You may find that $f(x)$ is positive and decreasing from the minimum $t$ up to that time, in which case the player is unable to catch the ball before it stops and the solution is for the player to head directly to the ball's final position and to set $t$ so that $P_S t$ is the distance to that position.