4 Bugs chasing each other differential equation

Solution 1:

Let the process take place in the square $|x|\leq 1$, $|y|\leq1$ of the complex $z$-plane. If $t\mapsto z(t)$ describes the movement of ant $A_0$ then the movement of the other ants is given by $$t\mapsto i^k\ z(t)\qquad(1\leq k\leq 3)$$ (for a proof see the appendix below). By the given law of motion we have $$\dot z(t)\ =\ \lambda(t)\bigl(i\,z(t)-z(t)\bigr)$$ for some function $t\mapsto \lambda(t)>0$. As the velocity $v$ is given the factor $\lambda$ is determined by the condition $$v=|\dot z|=\lambda \sqrt{2}\,|z|\ .$$ Therefore $t\mapsto z(t)$ obeys the differential equation $$\dot z=v\ {i-1\over\sqrt{2}}\ {z\over|z|}\ .$$ We now write $z$ in the form $z(t)=r(t)\,e^{i\theta(t)}$, whereupon our differential equation becomes $$(\dot r + i r\dot\theta)e^{i\theta}\ =\ v\Bigl({i\over\sqrt{2}}-{1\over\sqrt{2}}\Bigr)\,e^{i\theta}\ .$$ Cancelling $e^{i\theta}$ and separating real and imaginary parts gives $$\dot r=-{v\over\sqrt{2}}\ ,\qquad \dot\theta ={v\over\sqrt{2}}\ {1\over r}\ ,$$ and we have the initial conditions $r(0)=\sqrt{2}$, $\ \theta(0)={\pi\over4}$.

We immediately get $$r(t)=\sqrt{2}\Bigl(1- {v\over 2}\ t\Bigr)\ ,$$ from which we deduce that the process is over after time $T:={2\over v}$. Using this we find via a second integration $$\theta(t)\ =\ {\pi\over4} +\log{1\over 1-{v\over2} t}\qquad(0\leq t<T)\ .$$ This shows that the ants turn ever faster around the origin towards the end of the process.

Appendix, added 10/12/18:

Note that for any given initial conditions ${\bf z}(0)=\bigl(z_1(0),\ldots, z_4(0)\bigr)$ the behaviour $t\mapsto{\bf z}(t)\in{\mathbb C}^4$ of the ants is uniquely determined for all $t$, up to the first collision.

The inherent symmetry suggests the working hypothesis (a heuristic tool) that the configuration of the ants is a square at all times. Using this hypothesis a solution $t\mapsto{\bf z}(t)$ is found that fulfills all requirements of the problem; hence it is the solution.

Of course there is also a structural proof that there will be no "symmety breaking". The "natural laws" that govern the behavior of the ants (described in the linked question) are invariant under rigid movements (rotations or translations) of the plane. This implies the following: If $T$ is such a movement then replacing the initial conditions ${\bf z}(0)$ by $${\bf w}(0):=\hat T{\bf z}(0):=\bigl(Tz_1(0),\ldots, Tz_4(0)\bigr)$$ results in the solution $t\mapsto{\bf w}(t)=\hat T{\bf z}(t)$. In the case at hand we have ${\bf z}(0)=(1,i,i^2,i^3)$, and $T$ is the $90^\circ$ rotation $z\mapsto iz$ around the origin, so that ${\bf w}(0)=(i,i^2,i^3,1)$. It follows that $w_1(t)=i z_1(t)$ for all $t$. On the other hand $w_1(t)$ can be viewed as orbit of the ant starting at $i$ in the original ant problem.

Solution 2:

Hints: Assume the square is centered at zero and the affix of the position of $A$ at time $t$ is $r(t)\mathrm e^{\mathrm i\theta(t)}$. Then:

  1. The affixes of the positions of $B$, $C$ and $D$ at time $t$ are $\mathrm ir(t)\mathrm e^{\mathrm i\theta(t)}$, $-r(t)\mathrm e^{\mathrm i\theta(t)}$ and $-\mathrm ir(t)\mathrm e^{\mathrm i\theta(t)}$ respectively.
  2. Hence, for example, the line $AB$ has the direction of $(\mathrm i-1)\mathrm e^{\mathrm i\theta(t)}$.
  3. At time $t$, the tangent of the curve that $A$ makes has the direction of $(r'(t)+\mathrm ir(t)\theta'(t))\mathrm e^{\mathrm i\theta(t)}$.
  4. The square of the speed at time $t$ is $(r'(t))^2+(r(t)\theta'(t))^2$.

The steps of the proof are as follows. Points 2. and 3. combined yield a first order differential equation characterizing the motion of $A$, hence of $B$, $C$ and $D$ through point 1. Solving this yields $\theta(t)$ as a function of $r(t)$. Finally, point 4. determines $r(t)$.

Solution 3:

This problem can be solve using a well know result of calculus for polar coordinates

$tan(\psi) = \frac{r(\theta)}{\frac{dr(\theta)}{d\theta}}$

where $\psi$ is the angle between tangent line and radial line at $r(\theta)$.

Let's use center of square (or n sided regular polygon) as the origin of polar coordinates and a vertex on line $\theta = 0$. So the vertex's coordinate is (r, $\theta$) = (1, 0).

Since each bug is chasing adjacent bug, all of them stay on some square (or n-polygon) of smaller size. Thus tangent of a bug's trace contains side of a square (n-polygon). Using this fact, we can conclude $\psi$ is sum of half of internal angle and external angle of a square (n-polygon), i. e.

  • $\psi = \frac{3\pi}{4}$ for square, thus $\tan(\psi)=-1$
  • $\psi = \frac{1}{2} \cdot \pi \cdot \frac{n-2}{n} + \frac{\pi}{n} = \pi \cdot (\frac{1}{2} + \frac{1}{n})$ for n-polygon, thus $tan(\psi) = -\frac{1}{tan(\frac{\pi}{n})}$

Using these result we can obtain the following differential equation for r($\theta$):

$\frac{dr(\theta)}{d\theta} = -tan(\frac{\pi}{n}) \cdot r(\theta)$

Integrate it and apply the initial condition we have

$r(\theta)= e^{-\tan(\frac{\pi}{n}) \cdot \theta} $

The length of bug trace can be calculated using following formula:

$D = \int _0^{\infty} \sqrt{(dr)^2 + r^2 (d\theta)^2 } = \sqrt{\tan^2(\frac{\pi}{n}) + 1} \int _0^{\infty} e^{-\tan(\frac{\pi}{n}) \cdot \theta} d \theta = \frac{\sqrt{\tan^2(\frac{\pi}{n}) + 1}}{\tan(\frac{\pi}{n})}=\csc(\frac{\pi}{n})$

For a square with its center at origin and one vertex at (0, 1), we have $D=\sqrt{2}$ which is length of its sides.

Solution 4:

I think I solved this. If bug 1 has coordinates $(x,y)$ then bug 2 has coordinates $(y,1-x)$ so since bug 1 moves into the direction of bug 2 the differential equation is

$$\frac{dy}{dx} = \frac{1-x-y}{y-x}.$$

Substitution of $x=p+1/2$ and $y=q+1/2$ leads to

$$\frac{dq}{dp}=\frac{p+q}{q-p}$$

and then with $f=q/p$ and $p=\exp(s)$ we get

$$\frac{df}{ds}=\frac{1+f^2}{1-f}$$

The solution starting at $(x,y)=(0,0)$ is the found through separation of variables

$$p = -\frac{\exp(\arctan(f)-\arctan(1))}{\sqrt{2(1+f^2)}}$$

from which as function of varying parameter $f$, $x$ and $y$ can be obtained.