For our bouncing ball example, we will monitor the quantity . Since
is proportional to
the ball's velocity just after it strikes the table for the
th time, we can think
of
as being a measure of the ball's kinetic energy at time
. To define this function,
find the location in the file bball_def.c which reads
/* ------------------------------------------------------------------------ function used to define aux functions of the varbs, time, or params ------------------------------------------------------------------------ */ /* int user_aux_func(f,x,p) double *f,*x,*p; { } */and edit it to produce
/* ------------------------------------------------------------------------ function used to define aux functions of the varbs, time, or params ------------------------------------------------------------------------ */ int bball_aux(f,x,p) double *f,*x,*p; { f[0] = x[1] * x[1]; }The number of auxiliary functions is completely arbitrary; it is not necessary to have any auxiliary functions. When this equation is called, the calling routine passes in the current state of the phase space variables (in x), the current parameters (in p), and an array (f) which is filled up by this function.
Adrian Bunk 2001-08-22