# Need to find a critical point of a differential equation

This question stems from an old 538 puzzle involving a duck in a pond and a fox patrolling the edge of the pond.

I was able to setup a system of ODEs that probably do not have an explicit solution:

pd = {rd[t] Cos[thetad[t]], rd[t] Sin[thetad[t]]}
pf = {r Cos[thetaf[t]], r Sin[thetaf[t]]}
thetadir = FullSimplify[ArcCos[pd.(pf - pd)/(Norm[pd]*Norm[pf - pd])]]

DSolve[{
thetaf'[t] == vf/r,
rd[0] == 10^-5,
thetaf[0] == 0
},
Assumptions -> {
t ∈ Reals, t >= 0,
r ∈ Reals, r > 1,
vd ∈ Reals, vd > 0,
vf ∈ Reals, vf > vd,
rd[t] ∈ Reals,
thetaf[t] ∈ Reals,
}
]


The desire is that I find vf/vd in terms of $r$ such that rd == r when thetad == thetaf. This will give the upper bound of the speed of a fox that a duck can escape.

The behavior of $rd$ is monotonic and unbounded when $vf/vd$ is less than this value. And it contains a local maximum when $vf/vd$ is greater than this value. (When it is equal to this value, then we get a divide by zero because Norm[pf - pd] == 0).

I can use NDSolve if I give initial values for vd, vf, and r, however, I don't know how to iterate through values of vd, vf, and r to where I can "zero in" on this critical point and find the relationship between these three values. Can I get some insight?

• You might benefit from ParametricNDSolve. Feb 21, 2017 at 16:41
• Can't you write explicitely the criticality conditions, by solving the system of "derivatives == 0", for the unknowns vd, vf, and r? Feb 21, 2017 at 18:37
• note since thetaf'[t] is constant you can remove that from the system of equations and simply use thetaf=vf/r t Feb 22, 2017 at 1:01
• FWIW the puzzle has a trivial (lower bound) solution that the duck can beat the fox if vf/vd < 1 + Pi. The actual solution is something more than that.. Feb 22, 2017 at 15:37
• Yeah, I found the correct solution. I was just chasing this idea to see what I got. Feb 22, 2017 at 16:25

Normalizing by setting r = 1 and vd (the speed of the duck) to 1, and then using ParametricNDSolve, provides functions in vf (speed of the fox) and t for rDuck, thetaDuck, and thetaFox. Findroot solves for rDuck = 1 (where the fox is) and thetaDuck = thetaFox.

The fox travels at a speed of 2.34 to meet the duck in 1.2, in whatever units are in use.

pd={rd[t] Cos[thetad[t]],rd[t] Sin[thetad[t]]} ;
pf={r Cos[thetaf[t]],r Sin[thetaf[t]]};
(* {vf\[Rule]2.3448618677572135,t\[Rule]1.2171083713163402} *)