Professional Documents
Culture Documents
Abstract
Title Page
This paper will discuss the differential equations which describe curves of pure pursuit,
in which the pursuer’s velocity vector is always pointing directly toward the pursued.
JJ II
1. Pirates!
J I
We will begin with what is generally assumed to be the original pursuit problem, posed by
French mathematician and hydrographer Pierre Bouger in 1732. The problem was published in
the French Academy’s Mémoires de l’Académie Royale des Sciences and it deals with a pirate Page 1 of 27
ship pursuing a merchant vessel. The merchant vessel is taken to be at (x0 , 0) at time t = 0, and
travels at a constant speed Vm along the vertical line x = x0 . (See Figure 1). The pirate ship
starts at (0, 0) at time t = 0 and travels at constant speed Vp along a curved path, such that Go Back
its velocity vector is always pointing directly at the merchant vessel. This is what is defined
as a pure pursuit, and is described geometrically in Figure 1. The problem is to determine the
equation y = y(x) for the pirate’s curve of pursuit. Full Screen
If the location of the pirate ship at time t ≥ 0 is the point (x, y), and the merchant vessel’s
position is the point (x0 , Vm t), the slope of the tangent line to the pursuit curve at (x, y) is
Close
dy Vm t − y y − Vm t
= = .
dx x0 − x x − x0
Quit
Pirates!
Pursuit Curve for a Circle
Alternate Equations
y
Title Page
Vm t − y
JJ II
(x, y)
x0 − x J I
y = y(x)
Page 2 of 27
x
x0
Go Back
Close
Quit
Solving this for t,
y (x − x0 ) dy
t= − . (1)
Vm Vm dx
Pirates!
Further, we know that the pirate ship has always sailed a distance of Vp t along the pursuit
Pursuit Curve for a Circle
curve. Employing the arc length formula, we get
Alternate Equations
s 2
Z x
dy
Vp t = 1+ dz .
0 dz Home Page
1 (x − x0 )
Z xp
y
1 + [p(z)]2 dz = − p(x) .
Vp 0 Vm Vm Go Back
1p 1 dy (x − x0 ) dp 1 Full Screen
1 + [p(x)]2 = − − p(x) ,
Vp Vm dx Vm dx Vm
which, after replacing dy/dx on the right hand side with p(x), reduces to Close
dp
(x − x0 ) = −n 1 + [p(x)]2 , (3)
p
dx Quit
where n = Vm /Vp .
This differential equation is solvable analytically. The first step is to separate the variables,
letting p = p(x).
dp −ndx
= . Pirates!
1+p
p
2 x − x0
Pursuit Curve for a Circle
We then integrate both sides using a table of integrals [3], Alternate Equations
Home Page
Now, since p = dy/dx, and the pirate’s velocity is always pointed directly toward the merchant
ship, at time t = 0 the pirate’s velocity is dy/dx = 0. Solving for C, we find that C = −n ln(x0 ).
Inserting this result into equation (4), Title Page
−n
x
p+ 1 + p2 = 1 −
p
.
x0 Quit
At this point, a new variable, q, will be introduced, where q = (1 − x/x0 )−n . This will simplify
the algebra of the next few steps.
p+ 1 + p2 = q
p
Pirates!
Pursuit Curve for a Circle
1 + p2 = (q − p)2
Alternate Equations
1 + p2 = q 2 − 2qp + p2
2qp = q 2 − 1
Home Page
1 1
Title Page
p= q− . (6)
2 q
Substituting back in for p and q, we have JJ II
" −n n #
dy 1 x x
= 1− − 1− . J I
dx 2 x0 x0
We can now integrate both sides with respect to x:
Page 5 of 27
−n n
1 1
Z Z
x x
y(x) + C = 1− dx − 1− dx .
2 x0 2 x0
Go Back
Letting u = 1 − x/x0 , du = (−1/x0 ) dx, our integral becomes
1 1
Z Z
y(x) + C = −x0 u−n du − −x0 un du . Full Screen
2 2
We are now ready to integrate the right hand side, which yields the following result
Close
1 1
−n+1 n+1
u u
y(x) + C = − x0 + x0 .
2 −n + 1 2 n+1
Quit
Simplifying,
1 u−n+1
n+1
u
y(x) + C = x0 −
2 n + 1 −n + 1 Pirates!
1 u−n
n Pursuit Curve for a Circle
u
= x0 u − .
2 n + 1 −n + 1 Alternate Equations
1 1 1
C= x0 − Page 6 of 27
2 1+n 1−n
1
−2n
= x0
2 1 − n2 Go Back
n
C=− x0 .
1 − n2
Full Screen
We now have our solution to equation (3),
u1 = y JJ II
u2 = y . 0
Next, differentiate, J I
u01 = y 0 Page 7 of 27
u02 =y .
00
Go Back
Now we can substitute appropriately, making sure our new equations contain only u’s and no
y’s,
Full Screen
u01 = u2
−n 1 + u22
p
Close
u02 = .
x − x0
We define the vector u as follows. Quit
u1
u=
u2
u01 Pirates!
u =
0
u02 Pursuit Curve for a Circle
Alternate Equations
We see that u is a column vector, with u1 as its first entry and u2 as its second. We will take
advantage of this to write a function m-file for our system using the following code:
Home Page
function uprime = piratechase(x,u,n,x0)
uprime = zeros(2,1);
uprime(1) = u(2); Title Page
uprime(2) = -n*sqrt(1+(u(2))^2)/(x-x0);
Then, we can write a script file that calls on ode45 to solve the system numerically. We JJ II
begin by choosing a time span, initial conditions, and values for n and x0 .
tspan=[0,15]; J I
init=[0,0];
n=.3;
x0=10; Page 8 of 27
We then ”capture” the results from ode45 in the variables t and u, and plot the variable t
versus the first u-column, which represents u1 , or y. This results in the curve in Go Back
[t,u] = ode45(@piratechase,tspan,init,[],n,x0);
plot(t,u(:,1)); Full Screen
3
Title Page
2.5
y(x)
2 JJ II
1.5
J I
1
0.5 Page 9 of 27
0
0 5 10 15 Go Back
x-axis
Close
Quit
Pirates!
Pursuit Curve for a Circle
n = 0.3 Alternate Equations
4
3
Title Page
2.5
y(x)
2 JJ II
1.5
J I
1
0.5 Page 10 of 27
0
0 5 10 15 Go Back
x-axis
Close
Quit
The above code produces the plot seen in figure 2.
Next we will graph the solution we found in the previous section. This is done by first
defining n and x0 ,
n=.3; x0=10;\ ,
Pirates!
then we define a domain for x, our equation for y(x), and plot the result with a line Pursuit Curve for a Circle
command. Alternate Equations
x=linspace(0,x0);
y = .5*(x0-x).*((1-x/x0).^n/(1+n)-(1-x/x0).^-n/(1-n))+n*x0/(1-n^2);
line(x,y) Home Page
This code produces the plot in figure 3. We can see that the two graphs are identical, so
our solution is confirmed. Title Page
The problem posed by A.S. Hathaway, as stated by Nahin (2007), is this: ”A dog at the center
of a circular pond makes straight for a duck which is swimming [counterclockwise] along the J I
edge of the pond. If the rate of swimming of the dog is to the rate of swimming of the duck as
n : 1, determine the equation of the curve of pursuit...”[1].
Page 11 of 27
We will begin with a vector approach, illustrated by figure 4 (since dog and duck both start
with d, we will use h(t) to represent the hound’s position vector). The vector ρ (t) represents
the distance between the hound and the duck, so we have Go Back
Home Page
Title Page
ρ (t)
d(t) JJ II
J I
hound
Page 12 of 27
h(t)
O x
Go Back
Full Screen
Quit
Since the hound’s velocity vector is always pointing directly toward the duck (the definition of
a pure pursuit), dh(t)/dt is always pointing from hound to duck, and, |dh(t)/dt| is the hound’s
speed. Further, since ρ (t) = d(t) − h(t) points from the hound to the duck, a unit vector
pointing from the hound to the duck is
ρ (t) Pirates!
,
|ρρ(t)| Pursuit Curve for a Circle
Alternate Equations
so the hound’s velocity vector is
s 2 2
dh(t) dxd dyd d(t) − h(t)
=n + · . Close
dt dt dt |d(t) − h(t)|
Quit
This can be written in Cartesian coordinates as
s 2 2
dxh dyh dxd dyd (xd − xh ) + i(yd − yh )
+i =n ·p . (11)
dt dt dt dt (xd − xh )2 + (yd − yh )2 Pirates!
Equating the real and imaginary parts of (11) gives the general differential equations of pur- Pursuit Curve for a Circle
suit. Note that these equations work for any path followed by the prey that can be written Alternate Equations
parametrically.
s 2 2 Home Page
dxh dxd dyd xd − xh
=n + ·p (12)
dt dt dt (xd − xh )2 + (yd − yh )
Title Page
and s 2 2
dyh dxd dyd yd − yh
=n + ·p . (13)
dt dt dt (xd − xh )2 + (yd − yh ) JJ II
If the duck swims around the unit circle, starting at (1, 0), then xd = cos(t) and yd = sin(t),
so the first term in equations (12) and (13) becomes J I
s 2 2
dxd dyd
q
n + = n sin2 (t) + cos2 (t) = n . Page 14 of 27
dt dt
When we substitute this in equations (12) and (13), we get the differential equations of pursuit
when the prey is following the unit circle: Go Back
dxh cos(t) − xh
= np (14)
dt (cos(t) − xh )2 + (sin(t) − yh )2 Full Screen
and
dyh sin(t) − yh
= np . (15) Close
dt (cos(t) − xh )2 + (sin(t) − yh )2
Quit
n = 0.3 n = 0.5
1 1
Pirates!
Pursuit Curve for a Circle
Alternate Equations
0.5 0.5
Home Page
0 0
Title Page
−0.5 −0.5
JJ II
−1 −1
J I
−1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1
1 1
Go Back
0.5 0.5
Full Screen
0 0
Close
−1 −1
We can graph these equations very easily in Matlab, as we did above. The following code
produced to plots in figure (5). As before, we begin by declaring the time span and initial
conditions, as well as n, where the hound moves n times the speed of the duck.
tspan = [0,100];
Pirates!
init = [0;0];
n = 0.3; Pursuit Curve for a Circle
Alternate Equations
The various starting points for the hound can be achieved by varying the init vector. For
instance, the graph where n = 0.7 was made with the command init = [-1;-1]. Next we call
on ode45, storing the results in the variables t and y, then plot y1 versus y2 , Home Page
[t,y]=ode45(@pursuit,tspan,init,[],n);
plot(y(:,1),y(:,2),’r--’) Title Page
After obtaining numerical results for several values of n and various initial positions of the
hound, it appears that the hound eventually reaches what looks like a circular limit cycle, the
JJ II
radius of which seems to be dependent on n. We can investigate this behavior more closely by
switching coordinate systems. We will do so with the following approach.
J I
3. Alternate Equations
Page 16 of 27
We will begin by taking the duck’s path to be a circle of radius a, and the duck’s initial position,
at time t = 0 at the point (a, 0), as seen in Figure 6. At time t > 0 the duck has moved through
an arc angle θ, (a distance aθ), so the dog (swimming n times faster than the duck), moves a Go Back
distance of s = anθ to the point (x, y). The dog is executing a pure pursuit, so the tangent
line to the dog’s pursuit curve at the point (x, y) will pass through the duck’s position. This
tangent line makes an angle ω with the x-axis, and the distance between the dog and the duck Full Screen
(along the tangent line) is ρ.
The slope of the tangent line at the point (x, y) is tan(ω), so the equation of the tangent
line, in slope-intercept form, is given by Close
sin(ω)
y = x tan(ω) + b = x +b . (16)
cos(ω) Quit
Pirates!
Pursuit Curve for a Circle
y
Alternate Equations
Home Page
duck
ρ
a Title Page
(x, y)
θ ω
x JJ II
x0 (a, 0)
J I
Page 17 of 27
Go Back
Close
Quit
To find b, we use the fact that the line passes through the duck’s position at the point
(a cos(θ), a sin(θ)):
sin(ω)
a sin(θ) = a cos(θ) +b .
cos(ω) Pirates!
Pursuit Curve for a Circle
To clear fractions, we multiply both sides by cos(ω),
Alternate Equations
= a sin(θ − ω)
= −a sin(ω − θ) JJ II
ρ a cos(ω − θ) − ρ
d1 = a − = ,
cos(ω − θ) cos(ω − θ)
Pirates!
which tells us that the x and y values of the point of intersection are
Pursuit Curve for a Circle
or
Home Page
duck
d2 φ=ω−θ
ρ
Title Page
d1 (x, y)
θ ω
x JJ II
x0 (a, 0)
J I
Page 20 of 27
Go Back
Close
Quit
dx dω dy dω dω
sin(ω) + x cos(ω) − cos(ω) + y sin(ω) = a cos(ω − θ) −1 ,
dθ dθ dθ dθ dθ
or, grouping the dω/dθ terms together and factoring,
Pirates!
dx dy dω dω Pursuit Curve for a Circle
sin(ω) − cos(ω) + [x cos(ω) + y sin(ω)] = a cos(ω − θ) −1 .
dθ dθ dθ dθ Alternate Equations
By equation (19), the factor in square brackets on the left-hand side is a cos(ω − θ) − ρ, so we
have Home Page
dx dy dω dω dω
sin(ω) − cos(ω) + a cos(ω − θ) −ρ = a cos(ω − θ) − a cos(ω − θ) Title Page
dθ dθ dθ dθ dθ
or,
dx dy dω JJ II
sin(ω) − cos(ω) − ρ = −a cos(ω − θ) . (20)
dθ dθ dθ
Now, the variables x and y, at the dog’s position, must satisfy the pursuit curve, the tangent
J I
line to the curve, and the normal to the tangent line, and we can see from figure 8 that x and
y are related by
Page 21 of 27
dy
= tan(ω) .
dx
We know that, at any given time, the duck has moved through a distance of aθ (refer back Go Back
to figure 6), and since the dog travels at a speed n times that of the duck, the distance traveled
by the dog in the same amount of time will be s = anθ, which tells us that ds = andθ. From
figure 8 we see that Full Screen
dx
= cos(ω) Close
ds
dx
ds = ,
cos(ω) Quit
Pirates!
Pursuit Curve for a Circle
Alternate Equations
Home Page
Title Page
ds
dy JJ II
J I
Page 22 of 27
ω
Go Back
dx
Full Screen
Figure 8: The differential triangle relating ds, dx, and dy.
Close
Quit
so
dx
= andθ
cos(ω)
Pirates!
and
Pursuit Curve for a Circle
dx Alternate Equations
= an cos(ω) . (21)
dθ
We know, from the chain rule in calculus, Home Page
dy dy dx
= · = tan(ω)an cos(ω) ,
dθ dx dθ Title Page
so we have
dy JJ II
= an sin(ω) . (22)
dθ
Inserting (21) and (22) into (20), we see
J I
dω
an cos(ω) sin(ω) − an sin(ω) cos(ω) − ρ = −a cos(ω − θ) ,
dθ
Page 23 of 27
and now we finally arrive at the differential equation
dω
ρ = a cos(ω − θ) . (23) Go Back
dθ
We have two variables which describe the dog’s position, ω and ρ, so we get our second
differential equation by differentiating equation (19), which gives us Full Screen
dx dω dy dω dw dρ
cos(ω) − x sin(ω) + sin(ω) + y cos(ω) = −a sin(ω − θ) −1 − , Close
dθ dθ dθ dθ dθ dθ
or
Quit
dx dy dω dω dρ
cos(ω) + sin(ω) − [x sin(ω) − y cos(ω)] = −a sin(ω − θ) −1 − .
dθ dθ dθ dθ dθ
Pirates!
By equation (17), the factor in square brackets is a sin(ω − θ), so Pursuit Curve for a Circle
Alternate Equations
dx dy dρ
cos(ω) + sin(ω) = a sin(ω − θ) − .
dθ dθ dθ
Inserting (21) and (22) as before gives us Home Page
dρ
an cos2 (ω) + an sin2 (ω) = a sin(ω − θ) − ,
dθ Title Page
which leads to
dρ JJ II
an(cos2 (ω) + sin2 (ω)) = asin(ω − θ) − ,
dθ
which leads us to our second differential equation,
J I
dρ
= a[sin(ω − θ) − n] . (24)
dθ
Page 24 of 27
Referring back to figure 7, we can write φ = ω − θ, solving for ω and differentiating with
respect to θ, we get
Go Back
ω =φ+θ
dω dφ Full Screen
= +1 .
dθ dθ
By equation (23), we can write Close
dφ
ρ +1 = a cos(φ)
dθ Quit
dφ
ρ + ρ = a cos(φ) . (25)
dθ
Differentiating equation (24) with respect to θ gives us
Pirates!
d2 ρ dφ Pursuit Curve for a Circle
= a cos(φ) ,
dθ2 dθ Alternate Equations
which, when solved for dφ/dθ, becomes
2
d ρ
ρ + aρ cos(φ) = a2 cos2 (φ) . (26)
dθ2 JJ II
Now, being on a circular limit cycle means that, once the dog reaches its limit cycle, the
distance ρ between the dog and the duck will remain constant. This means that, as θ → ∞,
lim ρ = c. This also tells us that J I
Home Page
Title Page
R
JJ II
x
ρ
a J I
Page 26 of 27
Go Back
Quit
So, we can conclude that the constant distance between the duck on its circular path and the
dog on its circular limit cycle is given by
p
ρ = a 1 − n2 .
Pirates!
Further, if we let R be the radius of the limit cycle as in figure 9, using the Pythagorean theorem Pursuit Curve for a Circle
shows that R2 + ρ2 = a2 , so Alternate Equations
R=
p
a2 − ρ2 Home Page
R= a2 − a2 (1 − n2 )
p
R = an . Title Page
This tells us that, if n < 1, the curve of pursuit of the dog eventually settles down to a
circular limit cycle, the radius of which is n times the radius a of the duck’s circular path. JJ II
References J I
[1] Nahin, Paul J. (2007). Chases and Escapes: The Mathematics of Pursuit and Evasion.
Princeton, New Jersey: Princeton University Press. Page 27 of 27
[3] Stewart, James. (2003). Calculus: Early Transcendentals, 5th ed. Belmont, California: Go Back
Brooks/Cole-Thomson Learning.
[4] A User’s Manual for MetaPost. Documented version: 0.9. Full Screen
Close
Quit