iconEuler Examples

Child and Toy Tracks

by R. Grothmann

>load "child";

This notebook demonstrates solutions to the child and toy problem. A child is walking in the plane with a toy at the other end of a long stick. The problem is to determine the path of the toy.

The above Euler file contains functions for the numerical solution of the problem. The problem can be formulated as a differential equation, and we use the method of Heun to solve this equation numerically.

In the first example the child walks once around the unit circle and the stick is one unit long.


Child and Toy Tracks

You can watch the following animation of the result.


If the child continues to walk around the circle the toy will spiral to 0.


Child and Toy Tracks

However, if the stick is a little longer than the radius of the circle, the child will eventually push the toy forward. This results in a nice picture.


Child and Toy Tracks


If the stick is twice as long as the radius, we get a rosette.


Child and Toy Tracks

It is possible to pass own movements to the child function. E.g., we move a man along the x-axis with constant speed 1. We define a function which returns two vectors, the place and the speed.

>function childy(t) := {[t,0],[1,0]}

Then we can use it to generate our curve.


Child and Toy Tracks

This problem can be solved exactly. The solution will be the so called tractrix. From the geometry, the differential equation is obvious.

>eq &= 'diff(y,x)=-y/sqrt(1-y^2)
                         dy          y
                         -- = - ------------
                         dx               2
                                sqrt(1 - y )

Maxima can solve this.

>&assume(y>0); sol &= ode2(eq,y,x)
               2 sqrt(1 - y ) + 2              2
           log(------------------) - sqrt(1 - y ) = x + %c

The solution is implicit, so we get a function from y to x. We need to find the correct constant.

>&solve(sol with [x=0,y=1],%c); &solve(sol with %,x);  ...
 function f(y)&=rhs(%[1])
               2 sqrt(1 - y )   2              2
           log(-------------- + -) - sqrt(1 - y ) - log(2)
                     y          y

Now y runs from 0.01 to 1. We have to compute x=f(y).

>y1=linspace(0.01,1,100); x1=f(y1);

The result looks like our previous plot.


Child and Toy Tracks

Let us compare the true value of the last point in the curve, with our numerical simulation.

>f(y[2,-1]), y[1,-1]

For a more complicated example, the child walks along a sin curve.

>type childsin
function childsin (t)
    return {[t,sin(t)],[1,cos(t)]}

Now the child pushes the stick a short distance and then the stick stays behind it.


Child and Toy Tracks

There is a similar problem, where a dog runs towards a moving man. The dog has constant speed. Assume, the man runs once around the circle. What is the path of the dog?

The speed of the man equals the speed of the dog.


Child and Toy Tracks


Child and Toy Tracks


It is obvious that the dog approaches a circle with half the radius of the circle the man is running on.


Child and Toy Tracks


In the next example the man runs straight along the x-axis.


Child and Toy Tracks