next up previous contents
Next: Periodic Variables Up: Defining Labels and Initial Previous: Parameters   Contents

Auxiliary Functions

For our example, we have only a single function which we will call ``KE'' for kinetic energy. From the definition of the function (v2) and from the default plotting range for the variable v, the interval [0, 1000] is probably a suitable range on which to plot the value of v2. Accordingly, we edit a few more lines in bball_init():
static int     n_funct=1;                /* number of user-defined functions */
static char    *funct_names[]={"KE"};    /* list of funct names; {""} if none*/
static double  funct_min[]={0};          /* default funct min for display    */
static double  funct_max[]={1000};       /* default funct max for display    */

We remark that if we did not want to monitor any auxillary functions then we would set n_funct=0. The array of function names, however, must contain at least an empty string or else our code will not compile properly. In other words, if there were no auxillary quantities of interest, then we could write *funct_names[]="" but em not *funct_names[]=.



root
1998-11-02