Pursuit Problems

Mathematical Modeling

Richard Hitt
University of South Alabama
17 February 2000

Introduction

In this notebook we study a few of the many different type of pursuit problems frequently encountered in undergraduate differential equations and modeling courses.

Tractrix

As the first example, suppose we have a Coast Guard boat that wants to conduct surveillance on a suspected drug boat by keeping the distance between the two boats constant.  In particular, let's suppose the surveillance boat begins at the point (a,0) while the boat under surveillance begins at the origin and travels up along the y-axis at a constant velocity.  Find the path of the Coast Guard boat.  The path is called a tractrix.

Solution

We can use x as the independent variable and solve for y as a function of x (we don't need to introduce a variable for time).  
Draw a picture to show that the relevant initial value problem is

TractrixDE  = 
       {y'[x]  ==  -Sqrt[a^2 - x^2]/x,  y[a] == 0}

TractrixSolution  =  DSolve[TractrixDE,  y[x],  x]

\(a\  = \ 1; 

    Plot[Evaluate[y[x]\  /. \ TractrixSolution], \ {x,  .1, a}, \ 
      AspectRatio -> Automatic]\)

Dog Chasing Cat

In a slight variation of the first problem, suppose we have a cat located at the origin and a  dog located at the point (1,0).  The dog runs toward the cat at all times until the cat is captured.  If the speed of  the dog and the cat are given by  constants (Subscript[v, d]) and (Subscript[v, c]), respectively, where (Subscript[v, d]) ≥ (Subscript[v, c]), find the path of the dog and the length of time it takes for the dog to  overtake the cat.

Path Across a River

A straight river of width a is crossed by a boat (swimmer, or whatever) that always stays pointed toward its destination.  If the current of the river is c and the speed of the boat (swimmer, etc.) is s (s < c), find the path used to cross the river.

Solution

In class, we derived the differential equation with initial condition

Clear[a]SwimmerDE  = 
       {y'[x]  ==  
          (s y[x]  -  c Sqrt[x^2 + y[x]^2]) /(s x),  
        y[a]  ==  0}

where s is the speed of the swimmer, c is the speed of the current (going up on the coordinate system), and a is the x-coordinate of the starting location.

The solution to the IVP can be computed exactly using

SwimmerSolution1  =  DSolve[SwimmerDE,  y[x],  x]

Although this is correct, Mathematica misses some simplifications.  A simplified solution can be written as

SwimmerSolution2  =  
      y[x]  ->  
        (a/2) 
          ((x/a)^(1 - c/s)  -  (x/a)^(1 + c/s))

This solution can be plotted by specifying values for the parameters using either of the solutions.

a = 1; s = 2; c = 1; 
    Plot[y[x]  /.  SwimmerSolution1,  {x, 0, a},  
      AspectRatio -> Automatic]

Four Bug Problem

Four bugs are located at the corners of a square table.  The bugs are facing toward the center.  The table has side length 100 inches.  Simultaneously, the bugs begin walking toward the bug on their right at a constant rate of 1 inch/second.  Note that the bugs always lie at the corners of a square that is shrinking and turning counterclockwise.  When and where will the bugs meet?  How long will it take them to meet?  Find the path of the bugs.

We first attempt to exploit the symmetry of the problem to find one or more differential equations which will describe the motion. It  seems clear that  it suffices to describe the motion of the quadrant one bug. So let (x, y) denote the position of quadrant one bug and let (a, b) denote the position of quadrant two bug ( see figure below ). The pursuit strategy of the bugs is such that the tangent line to the path of the first bug must pass through the position of the second bug . It is also the case that the symmetry of the problem tells us that  a = - y   and  b = x. Since the derivative gives the slope of the tangent line, it follows that  the function  y[x] describing the path of quadrant one bug must satisfy the  differential equation ( y - x ) = y'[x] ( x + y ). This is the equation of the line tangent to the path of bug one and passing through the position of bug two.

l1={RGBColor[0,0,1],Line[{{-.7,0},{-.7,.6}}]};
l2={RGBColor[1,0,0],Line[{{-.7,.6},{0,.6}}]};
l3={RGBColor[0,0,1],Line[{{0,.65},{.6,.65}}]};
l4={RGBColor[1,0,0],Line[{{.6,.65},{.6,0}}]};
t1=Text["(a,b)",{-.7,.67}];
t2=Text["(x,y)",{.6,.75}];
Show[
	  Graphics[{l1,l2,l3,l4,t1,t2}],AspectRatio->Automatic,Axes->True,PlotRange->{{-1.2,1.2},{0,1.2}}]

So now it is time to let Mathematica  approximate the solution to this differential equation with the appropriate initial condition .

NDSolve[{y[x] - x==y'[x] (x + y[x]),y[1] == 1},y,{x, 0, 1}]

The range of  x values was picked rather arbitrarily here so it is worth a little experimentation to see for what set of values we can find a solution. The following may give some idea as how to proceed.

NDSolve[{y[x] - x==y'[x] (x + y[x]),y[1] == 1},y,{x, - .5, 1}]

So our  interpolating function seems to only apply to the interval from -0.207866 to 1. By checking the value of y at the x value -0.207866 it is clear that the bugs have not caught one another, so the pursuit should be ongoing.  You should use ParametricPlot to graph this last interpolating function to see that the difficulty is most likely the fact that the tangent line to our path is going vertical at  x = -0.207866. So maybe a slightly modified approach is called for. We will think of x and y as functions of the parameter time t  and try to solve a system of differential equations with t as the independent variable. You should execute the following code to see that there is still one further consideration to this modified approach.

NDSolve[{(y[t] - x[t]) x'[t]==y'[t] (x[t] + y[t]),x[0] == 1,y[0] == 1},{x, y},{t, 0, 100}]

So it looks like Mathematica  wants at least as many differential equations as there are unknown functions,  which in our case is two. The problem now is to write down a second differential equation for this pursuit problem. You should probably try some of your own thoughts here, but the approach taken in what follows is to try to put some condition on the rate at which the bugs are approaching the origin. Note that the distance the bug is from the origin is given by  
r = Sqrt[ x^2 + y^2 ]. Let's have the square of this distance decrease at a constant rate. So we try the following.

solution = 
     NDSolve[ {(y[t] - x[t]) x'[t]==y'[t] (x[t] + y[t]),
       x[t]*x'[t]  +  y[t]*y'[t]  ==  -0.01, 
       x[0]  ==  1, y[0]  ==  1}, {x,  y}, 
      {t,  0,  99.97}]

Having experimented a few times with this Mathematica  statement showed that this works fine until t gets to be 100, so we stop things just short of 100.

In - class exercise 1. Explain why the above Mathematica  code stops working at the t value of 100. Hint: think of the function  r(t) which describes the distance the bug is from the origin at time t .

We now graph our parametric solution to see that quadrant one bug spirals into the origin.

ParametricPlot[Evaluate[{x[t], y[t]} /. solution], {t, 0, 99.7}, 
      PlotRange -> {{-1, 1}, {-1, 1}}, 
      PlotStyle -> RGBColor[1, 0, 0]]

In - class exercise 2. Draw a single graph which shows the paths of all four bugs using a different color for each bug.

Finally, we can do a little animation of the path we found for the quadrant one bug. It is most likely the case that the following will need to be adjusted a little.  You may also want to adjust the number of frames produced for the animation, and memory management may be important here. In fact, you may want to use the built-in function Save to put the interpolating function in a file of its own so that it can be recovered easily just in case the following exhausts the available memory.

Do[ParametricPlot[Evaluate[{x[t], y[t]} /. solution], {t, 0, k}, 
        PlotRange -> {{-1, 1}, {-1, 1}}, 
        PlotStyle -> RGBColor[0, 0, 1]], {k, 0, 99.9, 4.1}]

Submarine Search Problem

A destroyer spots an enemy submarine on the surface d miles away.  The submarine immediately dives and proceeds full-speed in an unknown direction along a straight line (we assume).  Find a path the destroyer can tkae that will guarantee that it is directly over the submarine at some point.  Presumably, the destroyer would then detect the submarine using conventional sonar.  Assume the velocity (Subscript[v, d]) of the destroyer is greater than the velocity (Subscript[v, s]) of the submarine.

Solution

In class, we assumed that the submarime would dive and proceed along a straight line at its maximum speed.  The strategy the destroyer could use would be to proceed toward the point where the submarine was spotted.  Placing the submarine at the origin and the destroyer at (d,0), we can compute the minimim time in which the destroyer might first be over the submarine.

Clear[a, s, γ]t1sol  =  Solve[(Subscript[v, s])*(Subscript[t, 1])  +  (Subscript[v, d])*(Subscript[t, 1]) ==  γ,  (Subscript[t, 1])]

So the destroyer should head straight toward the point where the sub was seen for (Subscript[t, 1])units of time.  At that point, the destroyer should begin a spiral that will place it potentially over where the sub would be if the sub followed a straight path away from the origin at an angle θ with the positive x-axis.

r[t_]  :=  (Subscript[v, s])*t*{Cos[θ[t]],  Sin[θ[t]]}

thetaprime  =  
      Solve[(Subscript[v, d])  ==  Sqrt[r'[t] . r'[t]], θ'[t]]

It suffices to keep just the positive solution, so we have

Sol1  =  thetaprime[[2]]

SubSolution  =  
      DSolve[{θ'[t] == 
            ((Sqrt[-Cos[θ[t]]^2 (Subscript[v, s]^2) - 
                  Sin[θ[t]]^2 (Subscript[v, s]^2) + (Subscript[v, d]^2)])/(t 
                (Sqrt[Cos[θ[t]]^2 + Sin[θ[t]]^2]) (Subscript[v, s]))), 
          θ[(Subscript[t, 1]) /. t1sol] == 0},  θ[t], t]

Since the destroyer is (Subscript[v, s])*t units from the origin, we want the destroyer to be located that same distance from the origin at an angle θ[t].  The curve the destroyer should follow from time (Subscript[t, 1]) on is given below.

\(\(\ v\_s = 1; \ \ v\_d = 3; γ = 4; 
    t\_1 = γ\/\(v\_d + v\_s\); 

    ParametricPlot[
      v\_s*t*{Cos[θ[t]], Sin[θ[t]]}\  /. \ SubSolution // 
        Evaluate, \ {t, t\_1, \ 9.2}, \ AspectRatio -> Automatic]\)\)

Exercises

Exercise 1

Explain the differential equation used to solve the tractrix problem.  In other words, derive the equation from the information given in the problem.

Exercise 2

Construct an animation for the tractrix solution curve that shows the drug boat and the Coast Guard boat moving along as a function of time.  In order to do this, you have to express the solution to the tractrix problem given in the notebook using time as the independent variable rather than x.

Exercise 3

Plot several solution curves for the swimmer problem where the values of a and c are held constant, and the swimmer's speed s is varied.

Exercise 4

Plot a solution for the submarine problem of your choosing, i.e., plot the path the destroyer would follow beginning at time t=0.