I'm currently investigating the following problem: Adam cycles along the y axis with a constant speed. A dog sits 50 meters from the origo on the x axis. When Adam reaches (0,0) the dog notices him and starts chasing him with constants speed, and every one minute the dog would modify the direction of its path so it would point to Adam. I managed to graph the "optimal" case when the dog instantly faces Adam as he moves. (u=is the speed of the dog, v=speed of adam, epsilon=when to the distance of the two is within a threshold so the dog "caught" adam)
{xF, yF} =
With[{u = 1, v = 1/2, \[Epsilon] = 1/10},
NDSolveValue[{y'[
t] == (y[t] - v t) x'[t]/x[t], (y'[t])^2 + (x'[t])^2 == u^2,
x[0] == 50, y[0] == 0,
WhenEvent[Abs[y[t] - v t] < \[Epsilon], "StopIntegration"]}, {x,
y}, {t, 0, \[Infinity]}]];
With[{tmax = xF["Domain"][[1, 2]]},
ParametricPlot[{xF[t], yF[t]}, {t, 0, tmax}]]
I'm interested in the non-optimal case when there is a "delay" with the casing path of the dog. I think I figured out a way to map the movement of the dog and Adam. In most cases the dog won't reach adam and it will oscillate around Adam. My questions are: Which are those {v,u} speeds when the dog catches Adam within finite time? And is there a way to graph the distances between Adam and the dog?
e = {0, 1};
v = 1; u = 2
F[{A_?VectorQ, B_?VectorQ}] := {A + e*v, B + Normalize[(A - B)] u}
data = NestList[F, {{0, 0}, {50, 0}}, 50]; dataA =
data[[All, 1]]; dataB = data[[All, 2]];