On swimmer’s strategies in various currents

Amir Aghamohammadia,111e-mail<EMAIL_ADDRESS>, Cina
Aghamohammadib,222e-mail<EMAIL_ADDRESS>Saman Moghimi-
Araghic,333e-mail<EMAIL_ADDRESS>
a Department of Fundamental Physics, Faculty of Physics, Alzahra University,
Tehran, Iran,

b Princeton Neuroscience Institute, Princeton University, Princeton, NJ 08540,

c Physics department, Sharif University of Technology, P.O. Box 11155-9161,
Tehran, Iran

###### Abstract

Finding an optimum strategy to reach a certain destination by swimming in a
background flow is an interesting question which leads to non-trivial results
and swimming paths. Here we consider different strategies for various types of
surface currents, including parallel currents, and currents resulting from
spring sources, and sinks. Swimmers may instinctively swim toward the
destination point. It turns out that this idea may not lead to the desired
result in the presence of the background current. We will show in some cases
the best strategy is to swim towards a certain point other than the actual
destination. A different strategy may be to obtain the path of the least time
and then follow the minimized path. We study this alternative strategy, too.

Keywords: Zermelo’s navigation problem, rip current, pursuit problem

##  1 Introduction

We will discuss different strategies for swimming in a background flow field
in this article. Swimming in a pool differs from swimming in open water. This
is mainly due to currents. The swimmer would swim straight to his (her)
destination point if the water in the lake were still. When there are
currents, swimmers may instinctively swim toward the destination point.
However, when there are currents, this is not a good idea.

A geodesic is the shortest possible distance curve on a surface. The most
common example of a geodesic is a straight line in Euclidean geometry or any
arc of the great circles on a sphere. This can be rewritten as a moving
particle on a surface with a given speed, and ask about the shortest path or
minimum time required to reach the destination. One may extend the problem by
adding a background flow field. This extended problem was studied by Zermelo
[1]. He obtained a partial differential equation, now known as Zermelo’s
equation [2]. The same approach is also used for the geometry of sound rays in
a wind [3]. Although there is no general solution for Zermelo’s equation, and
finding an exact solution is nearly impossible in the vast majority of cases,
the problem may be solved numerically.

Problems of this nature can also be found in other contexts. The movement of
animals in the air and water may be affected by experienced flow is a similar
problem. As an example see [4]. Control theory was used to develop a benchmark
for time-minimizing (optimal) orientation there.

Another interesting analogous problem that at first glance may seem irrelevant
is the pursuit problem. There, we have two objects: a pursued and a pursuer.
Pursued moves along a trajectory while the pursuer follows. See e.g. [5, 6, 7,
8, 9]. Usually, the aim of these problems is to determine the trajectory of
the pursuer. Pursuers usually move toward pursuits instinctively. In [10], it
is shown that curvilinear motion on an inclined plane [10, 11] is analogous to
pursuit. Imagine a swimmer moving toward a fixed destination in the presence
of a current. The swimmer’s speed in still water is $w$, while the surface
layer is flowing at a constant velocity of ${\bm{u}}$. In a reference frame
moving with the current, this problem transforms into a standard chase problem
involving a pursuer chasing a pursued running with a constant velocity. In
view of the probable analogies between each of these problems, analyzing any
of them may help us gain a deeper understanding.

The ability to navigate in an unsteady flow field is crucial to a wide range
of robotic applications. In [12], deep reinforcement learning was used to find
time-efficient paths through an unsteady, two-dimensional flow field. It is
seen that simpler strategies such as swimming toward the target largely fail
at the task.

There are currents in open water, including those in rivers, oceans, and seas.
Some instances include rip currents, which pose a great threat to swimmers. A
rip current moves directly away from the shore like a river running out to
sea. To escape a rip, it is dangerous for a swimmer to use the wrong
strategies, such as fighting the current. In [13], an ’energetic cost’
strategy to escape from a rip current is presented. In this article, different
types of strategies for a swimmer who is going to reach a destination are
studied. We also consider different types of currents such as parallel
current, spring source, and sink. The concept of taking non-trivial strategy
to arrive at the desired point in a given background current make it quite
interesting and challenging to an undergraduate student. The problem and
examples addressed here may be of interest in the framework of an
undergraduate course in mechanics. Additionally, we believe that our
calculations provide skills that complete the formal training.

The organization of this work is as follows. Section 2 is devoted to
navigation in the parallel current. There may be different strategies:
swimming directly toward the destination, picking a guide and swimming
directly toward the chosen guide, and eventually swimming along the path of
least time. The strategy of the path of least time is equivalent to having a
flag or guide point at infinity. In sections 3 and 4, we assume there exists a
source or a sink that makes radial currents. In Section 5, mentioned
strategies are investigated when there exists a source or a sink. And finally,
section 6 is devoted to more sources and sinks.

##  2 Parallel current

Imagine that the water in a lake isn’t stagnant and that there is a current.
This might be the case of a typical river. The surface layer is flowing at a
constant and uniform velocity ${\bm{u}}$. The swimmer’s speed in still water,
$w$, may be greater, smaller, or equal to the current speed, $u$. The case of
$w=u$ is very interesting from pedagogical point of view. Therefore, although
it is quite a special case, we will begin with it and analyze it more
thoroughly than other cases.

###  2.1 $w=u$

There exist various strategies for the swimmer which we discus later, but the
instinctive strategy for a swimmer might be to swim towards point $O$. Take
the $x$ axis in the current direction, and set $O$ as the origin. Then the
swimmer’s velocity, ${\bm{v}}$, is a vector that’s made by adding two other
vectors, $-u\dfrac{\bm{r}}{|\bm{r}|}=-u{\bm{e}}_{r}$, the swimmer’s velocity
with respect to water which is towards the point $O$, and the other one
$u\bm{i}$ is the current velocity. The angle between these two vectors is
$\phi$, and the swimmer’s distance to the point $O$ is $r$. See figure (1).

Figure 1:  The swimmer’s path is a parabola with the destination as its foci,
if he/she swim toward destination.

It is seen that,

$\displaystyle\dot{r}=-u(1+\cos\phi)=-u(1-\cos\theta),$ (1)
$\displaystyle\dot{x}=u(1+\cos\phi)=u(1-\cos\theta).$ (2)

Therefore, $\dot{x}+\dot{r}=0$ or $x+r=x_{0}+r_{0}=:L$ is a constant, which is
the general equation of a parabola. So the path of the swimmer is a parabola
that starts from the point $A$, and the nearest point to $O$ along the
swimmer’s path is $C$. Actually, in this strategy, the swimmer never passes
the point $O$. Let us work out the path of the swimmer explicitly.

$r+r\cos\theta=L\quad\rightarrow\quad r=\frac{L}{1+\cos\theta},$ (3)

from which we can get the swimmer’s radial speed

$\dot{r}=\frac{L\,\dot{\theta}\sin\theta}{(1+\cos\theta)^{2}},$ (4)

which compared to (1), $\dot{\theta}$ can be obtained to be

$\dot{\theta}=\frac{-u}{L}\sin\theta(1+\cos\theta).$ (5)

Now let’s see how long it takes for the swimmer to reach the point $C$. In
order to get it, we use the relation for $\dot{\theta}$ and arrive at the
following integral

$T=\int_{0}^{T}\mathrm{d}t=\int_{\theta_{0}}^{0}\frac{-L\mathrm{d}\theta}{u\sin\theta(1+\cos\theta)}.$
(6)

This integral can be solved analytically, but there is no real need to do
that. Let us denote the time to reach $C$ from its nearby points by
$T_{\epsilon}$

$\displaystyle T_{\epsilon}=$
$\displaystyle\int^{0}_{\epsilon}\frac{-L\mathrm{d}\theta}{u\sin\theta(1+\cos\theta)}$
(7) $\displaystyle\approx$
$\displaystyle\int^{0}_{\epsilon}\frac{-L\,\mathrm{d}\theta}{2u\theta}=\frac{-L}{2u}\ln\theta\big{|}^{0}_{\epsilon}.$
(8)

$T_{\epsilon}$ is infinite. Considering the fact that $T>T_{\epsilon}$, T is
also infinite. As the swimmer approaches the x-axis, the size of his (her)
speed becomes smaller, and the swimmer never reaches the point $C$.

In order to have a complete discussion, let us compute precisely how long it
takes for a swimmer to traverse an arbitrary distance on the path: two point
on a parabola. We need to obtain the following integral

$\displaystyle T_{\theta_{1},\theta_{2}}=$
$\displaystyle\int_{\theta_{1}}^{\theta_{2}}\frac{-L\,\mathrm{d}\theta}{u\sin\theta(1+\cos\theta)}$
(9) $\displaystyle=$
$\displaystyle\dfrac{L}{2u}\,\left(\ln\left|\tan\left(\frac{\theta}{2}\right)\right|+\dfrac{1}{2}\tan^{2}\left(\frac{\theta}{2}\right)\right)\Big{|}_{\theta_{2}}^{\theta_{1}}.$
(10)

Where $\theta_{1}$ corresponds to the starting point, and $\theta_{2}$
corresponds to the destination. Here we have used
$\sin\theta=2\sin\theta/2\cos\theta/2$, and $1+\cos\theta=2\cos^{2}\theta/2$,
and the change of the variable $g:=\tan\theta/2$. The initial distance $L$,
and the speed $u$, can be used to construct a characteristic time,
$\dfrac{L}{u}$, which can be used to de-dimensionalizing time as
$\tau(\theta_{0}):=\dfrac{2uT_{\theta_{0},0}}{L}$. figure (2) depicts
dimensionless time $\tau(\theta_{0})$ versus $\theta_{0}$. As can be seen from
the figure, the time to reach the $x$ axis from the point,
$\theta_{0}=\dfrac{\pi}{2}$ and $r_{0}=L$, is infinite. So the strategy that
the swimmer swims towards the destination is a wrong choice. Later, we will
discuss some better strategies, however, we first consider the same strategy
when $w\neq u$.

Figure 2: Dimensionless time
$\tau(\theta_{0}):=\dfrac{2uT_{\theta_{0},0}}{L}$, versus $\theta_{0}$.

###  2.2 $w\neq u$

Now suppose the speed of the swimmer is not equal to $u$. Then total velocity
is

${\bm{v}}=-w{\bm{e}}_{r}+u\bm{i},$ (11)

which leads to the following velocity components in polar and Cartesian
coordinates

$\displaystyle\begin{cases}\dot{r}=-w+u\cos\theta\\\
r\dot{\theta}=-u\sin\theta.\end{cases}$
$\displaystyle\qquad\begin{cases}\dot{x}=u-w\cos\theta\\\
\dot{y}=-w\sin\theta.\end{cases}$ (12)

Dividing the velocity components in polar coordinates and defining the
dimensionless quantity $\alpha:=\dfrac{u}{w}$, we arrive at

$\displaystyle\dfrac{1}{r}\,\dfrac{{\rm d}r}{{\rm d}\theta}=$
$\displaystyle\dfrac{(1-\alpha\cos\theta)}{\alpha\sin\theta}$ (13)
$\displaystyle=$ $\displaystyle-\cot\theta+\dfrac{1}{\alpha\sin\theta}.$ (14)

This equation can be solved:

$\displaystyle\ln\left(\dfrac{r}{r_{0}}\right)=$
$\displaystyle\dfrac{1}{\alpha}\,\ln\big{|}\dfrac{\tan(\theta/2)}{\tan(\theta_{0}/2)}\big{|}-\ln\big{|}\dfrac{\sin\theta}{\sin\theta_{0}}\big{|},$
(15) $\displaystyle r=$ $\displaystyle
r_{0}\,\dfrac{\sin\theta_{0}}{\sin\theta}\,\left(\dfrac{\tan\theta/2}{\tan\theta_{0}/2}\right)^{1/\alpha}$
(16)

In figure (3), the path of swimmer for various values of $\alpha$ and
according to the initial conditions $\theta_{0}=\dfrac{\pi}{2}$ has been
drawn. If $w<u$ ($\alpha>1$), the swimmer can not even reach to $x$ the axis,
and at large times, it can only swim against the direction of $\bm{u}$ moves
asymptotic to $x$ axis and away from the destination. Only when $w>u$
($\alpha<1$) the swimmer reaches its destination.

Figure 3:  Path of a swimmer for various values of $\alpha$ and according to
the initial conditions, $\theta_{0}=\dfrac{\pi}{2}$ and $r(0)=r_{0}$.

Swimming time can be calculated exactly. Using eq. (12), one arrives at

$w\dot{r}+u\dot{x}=u^{2}-w^{2}.$ (17)

Integrating the above equation one arrives at

$\displaystyle wr+ux=wr_{0}+ux_{0}+(u^{2}-w^{2})t,$ (18) $\displaystyle
r=\dfrac{r_{0}(1+\alpha\cos\theta_{0})+(\alpha^{2}-1)wt}{(1+\alpha\cos\theta)}.$
(19)

As it is seen from (12), $\dot{r}<0$ for $\alpha<1$. Thus $r$ is a decreasing
function of time, for $\alpha<1$. As $r$ tends to zero, time approaches $T$

$T=\dfrac{r_{0}(1+\alpha\cos\theta_{0})}{w(1-\alpha^{2})}.$ (20)

###  2.3 Second strategy: Guide

In the previous section we showed that the simple strategy to swim towards the
destination works only if the swimmer’s speed $w$ is greater than $u$. Let us
assume that $w$ is equal to $u$ and propose another strategy that may lead to
arrival at the destination. We state the new strategy as follows: Instead of
swimming towards the actual destination, swimmer may pick a guide point and
swim towards it. In other words, we put a fictitious flag at some certain
point and the swimmer always try to reach the flag. From what we have obtained
in previous sections, it is clear that the starting point, $A$, and the
destination, $O$, are located on a parabola, whose focus is the guide point.

With that problem in mind, the issue now becomes a completely different
problem: How many parabolas are there which passes the points $A$ and $O$? And
where are the loci of their foci (the guide’s position)? In figure (4) a
parabola and its focus, which is shown by a flag, is plotted.

Figure 4:  The path of the swimmer will be a parabola with the flag at its
foci if he/she swims toward the guide, shown by a red flag. The loci of the
points we should set the flag is a hyperbola (shown by green dashed line) for
which two points, initial and destination ($A$ And $O$) are its foci.

The axes of symmetry for any of these parabolas run parallel to the $x$ axis
and all of their directrices are parallel to the $y$ axis. There are infinite
number of parabolas passing from the points $A$ and $O$. Let us show the
distance of the point $A$ ($O$) from one of the directrices by $\ell_{1}$
($\ell_{2}$). The distance of these points from the corresponding foci, shown
by a flag in figure (4), will be of the same values. If $x_{O}-x_{A}=a$, then

$\ell_{1}-\ell_{2}=a.$ (21)

Thus the loci of the foci of these parabolas are hyperbolas for which two
points of $A$ and $O$ are their foci.

In summary, if the swimmer take any point of this hyperbola as the guide and
sets there, say, a flag, he/she will reach the destination. Asymptotically the
swimmer may take a point on the hyperbola that is very far. This simply means
that the direction of his (her) velocity remains fixed and the path is a
straight line.

###  2.4 Third strategy: Time minimization

Third Strategy is based on finding the path that minimize the time needed to
reach the destination. In order to find the desired path, we may use the
techniques of calculus of variations. Let us first assume $w=u$. Then the
swimmer’s speed is $v=2u\cos\varphi$, where

$y^{\prime}=\tan(\pi-\varphi),$ (22)

is the slope of the path, denoted by $y(x)$. See figure (5).

Figure 5:  Calculus of variations can give us the path that minimizes time
needed to reach the destination.

The time of swimming is

$\displaystyle T=$ $\displaystyle\int{\rm d}t=\int\frac{{\rm
d}s}{v}=\int\frac{{\rm d}s}{2u\cos\varphi}$ (23) $\displaystyle=$
$\displaystyle-\dfrac{1}{2u}\int{\rm d}x\,(1+y^{\prime 2})=:\int{\rm
d}x\,J(y^{\prime}).$ (24)

Here we have used of

$\displaystyle{\rm d}s=$ $\displaystyle({\rm d}x^{2}+{\rm d}y^{2})={\rm
d}x\sqrt{1+y^{\prime 2}}$ (25) $\displaystyle\cos\varphi=$
$\displaystyle\frac{1}{\sqrt{1+\tan^{2}\varphi}}=\frac{1}{\sqrt{1+y^{\prime
2}}}.$ (26)

Then Euler’s equation

$\displaystyle\dfrac{\partial}{\partial x}\left(\dfrac{\partial J}{\partial
y^{\prime}}\right)-\dfrac{\partial J}{\partial y}=0,$ (27)

results in $y^{\prime}$ being constant. Hence, the curve that minimizes the
time is a straight line between two points $A$ and $O$. A similar argument can
be made for $w\neq u$. In the same manner as equation (24), $J$ only depends
on $y^{\prime}$, resulting in a straight line path. Note that even the path of
least time strategy is equivalent to having a flag or guide point at infinity.
If there is an answer to such a problem, then it is a straight line. However,
in some cases, the swimmer may not be able to reach the desired point. See
figure (6).

Figure 6:  If $w>u$, from anywhere in the blue trapezoid, the swimmer can
reach the point $O$. If both speeds are equal, $w=u$, then the wavy region
shows all the initial points where the swimmer can reach the point $O$. And
finally, if $w<u$, the swimmer can reach $O$, only when initially it is in the
trapezoid with the orange boarder.

It is always possible for the swimmer to reach point $O$ from any point inside
the blue trapezoid, shown in figure (6), provided $w>u$. If $w=u$, from
anywhere in the wavy region can reach $O$. And finally, if $w<u$, the swimmer
can reach $O$ only if it is initially in the trapezoid with orange boarder.

##  3 Source

Up to now, we have considered flows with uniform velocity. We would like to
investigate some other types of surface currents that a swimmer may encounter.
Another kind of velocity field which turns out to be interesting, at least
from the pedagogical point of view, is a ‘source current’, by which we mean
the surface velocity of water has a constant magnitude, however, it radially
flows outward from a specified point, the source point. Suppose there’s a
spring at the bottom of a lake that makes the water on the surface of the lake
move away from the source point $B$ with a radial velocity of $u$. The
assumption of uniform magnitude of radial velocity is not physical for a
uniform depth lake. The condition of incompressibility of water is
incompatible with such an assumption. This velocity field can be created by
having a spring, but at the same time the lake bottom is not flat. The lake’s
depth should decrease as $r^{-1}$ from the point that the water leaves the
spring, where $r$ is the distance from the spring. See figure (7).

Figure 7:  Swimming toward a destination, $O$, in the presence of a source at
$B$.

Let us assume that the velocity of the swimmer, $w$, is equal to $u$. The
swimmer’s velocity has two parts, $-u\dfrac{\bm{r}}{|\bm{r}|}=-u{\bm{e}}_{r}$
and $u\dfrac{\bm{r}^{\prime}}{|\bm{r}^{\prime}|}=u{\bm{e}}_{r^{\prime}}$,
where ${\bm{e}}_{r}$ ( ${\bm{e}}_{r^{\prime}}$) is the radial unit vector with
respect to the point $O$ ($B$). See figure (8).

Figure 8:  The swimmer’s path is an ellipse with the source and destination as
its foci ($B$ and $O$), if he/she swims toward destination.

The velocity components of the swimmer along $OA$ and $BA$ are

$\displaystyle\dot{r}=-u(1+\cos\phi),$ (28)
$\displaystyle\dot{r}^{\prime}=u(1+\cos\phi),$ (29)

which gives $\dot{r}+\dot{r}^{\prime}=0$. Swimmer move on a path for which
$r+r^{\prime}$, the sum of its distances from source and destination ($B$ and
$O$), remains constant, e.g. $L$. This is the general equation of an ellipse.
The swimmer’s path is an ellipse with $O$ and $B$ as its foci. $r^{\prime}$
can be written as

$r^{\prime}=\sqrt{r^{2}+\ell^{2}-2r\ell\cos\theta}=L-r,$ (30)

from which we obtain

$r=\frac{L^{2}-\ell^{2}}{2(L-\ell\cos\theta)}=:\frac{E}{1-e\cos\theta},$ (31)

where

$E:=\frac{L^{2}-\ell^{2}}{2L},\quad e:=\frac{\ell}{L}.$ (32)

Polar components of the swimmer’s velocity are

$\displaystyle\dot{r}=-u(1+\cos\phi),$ (33) $\displaystyle
r\dot{\theta}=u\sin\phi.$ (34)

Using the following relation between the angles $\phi$ and $\theta$

$\frac{\sin\phi}{\ell}=\frac{\sin\theta}{L-r}$ (35)

we arrive at

$\dot{\theta}=\frac{u\ell\sin\theta}{r(L-r)}.$ (36)

As $\theta$ (or $\phi$) tends to $\pi$, $\dot{\theta}$, and $\dot{r}$
approaches zero. It occurs at the point $C$, where the ellipse intersects the
axis $x$, and the swimmer stops. Although it starts heading in the direction
of point $O$, eventually it will stray away from point $O$ until it finally
stops at point $C$ a distance of $\dfrac{L-\ell}{2}$ away from point $O$.
Integrating (36), we obtain the time needed to reach $C$.

$T=\int_{0}^{T}\mathrm{d}t=\int_{\theta_{0}}^{\pi}\frac{\mathrm{d}\theta\
r(\theta)(L-r(\theta))}{u\ell\sin\theta}.$ (37)

Using similar arguments of subsection (2.1), the time it takes for the swimmer
to reach that point from the vicinity of the $C$ to it, is infinite, and as a
result, the total time to reach the point $C$ is also infinite.

However, the time needed to reach from any point on this path with
$\theta_{1}$ to another one, $\theta_{2}$, can be obtained exactly

$T_{\theta_{1}\to\theta_{2}}=T(\theta_{2})-T(\theta_{1})$ (38)

where $T(\theta_{i})$ is defined through

$\displaystyle T(\theta_{i}):=$
$\displaystyle-\dfrac{E}{2u\ell}\left[\dfrac{(e-1)\ell+E\ln(1-\cos\theta_{i})}{(e-1)^{2}}+\dfrac{(e\ell+\ell-E)\ln(1-\cos\theta_{i})}{(e+1)^{2}}\right.$
(39)
$\displaystyle\left.+\dfrac{2e}{(e^{2}-1)^{2}}\left(\dfrac{E(e^{2}-1)}{-1+e\cos\theta_{i}}+(\ell-e^{2}\ell-2E)\ln(1-\cos\theta_{i})\right)\right].$
(40)

Here $E$ and $e$ are defined through (32).

The case of ‘source current’ can also be studied when $w\neq u$. The results
are qualitatively the same as we have obtained previously, therefore, we will
not study them in detail. Instead, we consider another type of current: ‘the
sink current’.

##  4 Sink

Let us assume there are a sink on the bottom of the lake that cause the water
on the lake surface to move toward the point $B$ with a radial velocity of
$u$. Let us assume that $w$ is equal to $u$. This is very similar the
preceding one. The depth of the lake around the sink should vary proportional
to $r^{-1}$, where $r$ is the distance to the sink. The velocity of the
swimmer has two parts, $-u\dfrac{\bm{r}}{|\bm{r}|}=-u{\bm{e}}_{r}$ and
$-u\dfrac{\bm{r}^{\prime}}{|\bm{r}^{\prime}|}=u{\bm{e}}_{r^{\prime}}$, where
${\bm{e}}_{r}$ ( ${\bm{e}}_{r^{\prime}}$) is the radial unit vector with
respect to the point $O$ ($B$). See figure (9).

Figure 9:  The swimmer’s path is a hyperbola with the sink and destination
($B$ and $O$) as its foci, if he/she swims toward destination.

The velocity components of the swimmer along $OA$ and $BA$ are

$\displaystyle\dot{r}=-u(1+\cos\phi),$ (41)
$\displaystyle\dot{r}^{\prime}=-u(1+\cos\phi),$ (42)

which gives $\dot{r}-\dot{r}^{\prime}=0$. So the swimmer moves on a path for
which the difference of the its distance from two points $B$ and $O$ is
constant. This is the characteristic of the hyperbola: $r-r^{\prime}$ will be
a constant. The swimmer’s path is a hyperbola with $O$ and $B$ as its foci.
Then path can be obtained to be

$r=\frac{\ell^{2}-L^{2}}{2(L+\ell\cos\theta)}=:\frac{E}{1+e\cos\theta},$ (43)

where

$E:=\frac{\ell^{2}-L^{2}}{2L},\quad e:=\frac{\ell}{L}.$ (44)

As the swimmer approaches the $x$ axis, at point $C$, its velocity tends to
zero, where it eventually stops.

##  5 Strategy to arrive at the island when source (sink) is present

In previous sections, we showed that when the swimmer’s speed equals the
drift, aiming at the island does not result in arrival at it, rather, the
swimmer follows a part of an ellipse or a parabola and never reaches it.
Despite being driven away (towards) a sink (source), a swimmer can manage to
reach the island. Therefore, again a new strategy would be needed to follow.
We take the new strategy as state in the case of uniform flow: swimming
towards a third point, the guide, whose coordination is to be determined. This
means that we put a fictitious flag somewhere and tell the swimmer to swim
towards this flag. Let us concentrate on the case that a source is present at
the stream. With similar reasoning presented in the previous sections, we can
argue that the path of the swimmer is a part of an ellipse whose focal points
are the source point and the fictitious flag. As we are interested in reaching
the island, we have to choose a proper coordinate for the flag so that the
emerging ellipse passes the island. See figure (10).

Figure 10:  Swimming in the presence of a source using a flag as a guide. The
path will be an ellipse with the source and flag as its foci. The loci of the
points we should set the flag is a hyperbola (shown by yellow line) for which
two points, initial and destination are its foci.

We call the distances of the initial coordinate of the swimmer to the source
and the flag by $\ell_{1}$ and $\ell_{2}$, and the distances of the island to
the same points by ${\ell^{\prime}}_{1}$ and ${\ell^{\prime}}_{2}$. As the
path is a part of an ellipse, we have
$\ell_{1}+\ell_{2}={\ell^{\prime}}_{1}+{\ell^{\prime}}_{2}$ which means
$\ell_{2}-{\ell^{\prime}}_{2}={\ell^{\prime}}_{1}-\ell_{1}$. The right
handside of this equation is a fixed and known quantity, therefore, one
concludes that we have to put the flag at a point whose distance from the
swimmer’s initial coordinates and the island is this fixed quality. This makes
a hyperbola whose foci are these two points. Note that in the special case
where the flag is put at infinity, the path of the swimmer is not an ellipse,
rather, it is a hyperbola.

For the case of a sink, with very similar steps one can show that the flag
should be put at an arbitrary point on an ellipse whose foci are the swimmer’s
initial coordinates and the island. The interesting question is which choice
leads to the fastest arrival to the island.

###  5.1 The optimum path

In this step, we will investigate path of least time. Let us take the spring
at the origin. The path with the shortest time is shown by the orange line in
figure (11). It is more easier to use polar coordinates. Denoting the
swimmer’s velocity by $v=2u\cos(\varphi-\theta)$, and the differential path by
${\rm d}s=\sqrt{({\rm d}r)^{2}+(r{\rm d}\theta)^{2}}$, the swimming time is

Figure 11:  Swimming toward a destination in the presence of a source. The
path of least time is shown by orange line.

$\displaystyle T=$ $\displaystyle\int{\rm d}t=\int\frac{{\rm
d}s}{v}=\int\frac{{\rm d}s}{2u\cos(\varphi-\theta)}$ (45) $\displaystyle=$
$\displaystyle\dfrac{1}{2u}\int\frac{{\rm d}s}{{\rm d}r/{\rm
d}s}=\dfrac{1}{2u}\int\frac{(r^{2}+r^{\prime 2})\,{\rm d}\theta}{r^{\prime}}$
(46) $\displaystyle=:$ $\displaystyle\dfrac{1}{2u}\int J(r,r^{\prime})\,{\rm
d}\theta.$ (47)

Here the prime means differentiation with respect to $\theta$. Note that

${\rm d}r={\rm d}s\,\cos(\varphi-\theta)$ (48)

As $J(r,r^{\prime})=\dfrac{r^{2}}{r^{\prime}}+r^{\prime}$ does not explicitly
depend on $\theta$, we arrive at

$\displaystyle J-r^{\prime}\dfrac{\partial J}{\partial r^{\prime}}={\rm
constant}.$ (49)

This gives

$\displaystyle r^{\prime}=Cr^{2},\qquad\Rightarrow\qquad
r=\dfrac{1}{A-C\theta}.$ (50)

Here $A$ and $C$ are two constants can be obtained using the arrival and
destination coordinates. To interpret the path one may use the well-know
method of image. The yellow point with the red flag is the image of the source
with respect to the tangent line to the path at the point of swimmer. The
swimmer should move away from the flag. As the swimmer displaces on the path
the image will move too. If a sink has replaced the source at the origin,
principally, the path of least time does not change. Although it needs to
change ${\bm{v}}$ by $-{\bm{v}}$, and replace the start point and the
destination.

##  6 More sources and sinks

Up to now, we have considered the problem of a swimmer in the presence of just
one source/sink. As a mathematical problem, one can generalize the situation
to the case where more sinks and sources are present in the lake. Note that
even the parallel current case, can be obtained by putting a source/sink at
infinity. Furthermore, the velocity of the swimmer itself (when the swimmer
takes the strategy of swimming toward the destination) can also be interpreted
as a sink at the island while the swimmer just follows the total stream
velocity at each point.

Therefore, to go beyond what we have studied previously, the total number of
sink and source is at least three. We have to remember that at least have one
sink should be present in the system (due to the velocity of the swimmer). The
simplest cases are those which have exactly three total sources/sinks. We will
call them the source/sink A1, A2, and A3. Each of them produces a stream away
from/towards the corresponding point with the velocity $v_{i}$ with
$i\in\\{1,2,3\\}$. We may consider these velocities to be either positive or
negative to show if the point is a source or a sink. Moreover, we may
sometimes refer to these velocities as the strength of the sink/source. Three
typical cases are shown in figure (12). Generally, in such cases, the
resulting path of the swimmer cannot be obtained analytically. However, the
system can be analyzed as a dynamical-system problem and one can ask: ‘what is
the destiny of the swimmer?’.

Generally, the different destinies of the swimmer can be categorized in the
following way:

  * •

1) It will flow towards infinity.

  * •

2) It will arrive at one of the sinks.

  * •

3) The trajectory of the swimmer ends up somewhere in the lake where there is
neither a sink nor a source.

Plotting the phase portrait of such systems helps to understand these
different situations. Figure 12 shows the phase portraits of systems each
belonging to one of the above categories. The coordinates of the three
sources/sinks are considered to be on an equilateral triangle, while the
velocities are taken to be $(1,-0.3,-0.3)$ and $(-3,1,1)$ and $(1.5,-1,-1)$ in
sub-graphs $(a)$, $(b)$, and $(c)$, respectively. In case $(a)$, the positive
velocity of the source is greater than the magnitude of the sum of the sink
velocities. Therefore, no matter where the swimmer begins, he/she will finally
flow with the stream towards infinity. On contrary, as in case $(b)$, when a
sink is more powerful than the sum of other sinks/sources, the swimmer’s path
ends in the sink. The more interesting case is when none of the sources or
sinks dominates the sum of the other two. An example of such cases is sketched
in figure (12c). The swimmer finally arrives at a point which is neither any
of the sources/sinks nor infinity: a fixed point is formed in this case. Of
course, in general, this fixed point needs not to be stable. For example, if
in the same case as above, the velocity $v_{1}$ is chosen to be less than
unity, the fixed point turns out to be an unstable one and the swimmer will
eventually arrive at either the point b or c, depending on the initial
condition.

Figure 12:  The phase portraits of a system of three sources/sinks. The
blue(black) dots represent sources(sinks). In case $(a)$, the positive
velocity of the source is greater than the magnitude of the sum of the sink
velocities. Therefore, no matter where the swimmer begins, he/she will finally
flow with the stream towards infinity. In case $(b)$, a sink is more powerful
than the sum of other sinks/sources, the swimmer’s path ends in the sink. In
case $(c)$, none of the sources or sinks dominates the sum of the other two.

It is possible to find the necessary condition for the stability of infinity
or a sink. Although we have considered the case of three sinks/sources, the
same argument can be applied to cases with more sinks/sources.

Stability of infinity: At infinity, all the sinks/sources can be considered to
be at the origin in the first approximation. Therefore, the flow at infinity
is a radial one with velocity $v_{\infty}=\sum_{i}v_{i}$. Hence, depending on
whether $v_{\infty}$ is positive or negative, infinity would be stable or
unstable.

Stability of a sink: It is clear that a source cannot be stable. However, if a
sink is strong enough, it can be a stable point. The velocity field in the
vicinity of the sink $j$ can be written in the following form:

$ v=v_{j}{\bm{e}}_{r}+\sum_{i\neq
j}v_{i}{\bm{e}}_{ji}=v_{j}{\bm{e}}_{r}+v_{\rm other}{\bm{s}}.$ (51)

where, ${\bm{e}}_{ji}$ is the unit vector in the direction
${\bm{r}}_{j}-{\bm{r}}_{i}$. To be specific, the term $v_{\rm other}{\bm{s}}$
is velocity field due to other points at the point $j$, we have chosen
${\bm{s}}$ in a way that $v_{\rm other}>0$. If $v_{\rm other}<|v_{j}|$, the
sink $j$ would be stable because the radial inward velocity dominates the flow
due to the other points. However, if $v_{\rm other}>|v_{j}|$ the sink is not a
fixed point at all.

The third case, where the fixed point is not at infinity or on a sink cannot
be treated so easily. One has to find the fixed point first, and through the
derivative matrix find out if the point is stable or not or if it is a saddle
point. It is worth mentioning that it is possible to have several fixed points
in a system of different types. For example, consider the case where two
sources with strength $v=1$ on points $(-1,0)$ and $(1,0)$ and a sink with
strength $v^{\prime}=-1$ on the origin. Both infinity and origin are stable
fixed points and there are two saddle fixed points on the $y$ axis. See figure
(13).

Figure 13:  A system of two sources with strength $v=1$ on points $(-1,0)$ and
$(1,0)$ and a sink with strength $v^{\prime}=-1$ on the origin. The system has
both infinity and origin as stable fixed points. There are also two saddle
fixed points on the $y$-axis.

##  7 Concluding remarks

We have considered the path of a swimmer in the presence of different
background surface currents. The problem shows both conceptual and
mathematical elegant points. One has to exploit some geometrical and also
algebraic tools to acquire a good understanding of the system. Additionally,
the concept of taking non-trivial strategy to arrive at the desired point in a
given background current make it quite interesting and challenging to an
undergraduate student. Moreover, analyzing the system using dynamical system
tools help the student see the whole system from a completely different point
of view.
Acknowledgment: The work of A. Aghamohammadi was supported by the research
council of the Alzahra University. A. A. would like to thank M. Khorrami for
useful comments.

## References

  * [1] E. Zermelo, ZAMM‐Journal of Applied Mathematics and Mechanics/Zeitschrift für Angewandte Mathematik und Mechanik 11, no. 2 (1931) 114-124.
  * [2] A. E. Bryson & Y. Ho., “Applied optimal control: optimization, estimation, and control” (Taylor & Francis, 2018).
  * [3] G. W. Gibbons & C.M Warnick, Contemporary Physics, 52.3 (2011): 197-209.
  * [4] J. D. McLaren, J. Shamoun-Baranes, A. M. Dokter, R. H. Klaassen, & W. Bouten, Journal of the Royal Society Interface, 11 99 (2014) p.20140588.
  * [5] P. J. Nahin, “Chases and Escapes: The Mathematics of Pursuit and Evasion” (Princeton Univ. Press, 2012)
  * [6] A. Bernhart, Scripta Mathematica 20 (1954) 189-206; 23 (1957) 49–65; 24 no. 3 (1959) 189-206.
  * [7] T. J. Richardson, Annals of Mathematics and Artificial Intelligence 31 no. 1 (2001) 127-146.
  * [8] J. A. Marshall, M. E. Broucke, & B. A. Francis, IEEE Transactions on automatic control 49 (2004) 1963-1974.
  * [9] C. E. Mungan, European Journal of Physics, 26 (2005) 985-990.
  * [10] V. M. Shunyakov & L. V. Lavrik, American Journal of Physics 78 (2010) 1406-1411.
  * [11] C. Aghamohammadi & A. Aghamohammadi; Eur. J. Phys. 32 (2011) 1049-1057.
  * [12] P. Gunnarson, I. Mandralis, G. Novati, P. Koumoutsakos, & J. O. Dabiri, Nature Communications, 12 (2021) 1-7.
  * [13] A. Withers & S. Maldonado, Natural hazards 108 no. 2 (2021) 1449-1467.